Browse Source

[fix]

基础资料 请购单
修改请购单添加、编辑、详情页面,功能正常;
修改请购单、vo和详情实体类,新增字段;
修改请购单列表页面,调整表格字段显示结构;
修改请购经理、主管、副总经理、总经理审批页面,调整显示效果;
修改请购单controller,新增获取业务员接口;
修改请购单列表查询service接口,添加角色限制;
修改请购单和详情mapper,添加字段,修改列表查询mapper方法,实现模糊搜索;
dev
王晓迪 2 months ago
parent
commit
fd86952d17
  1. 24
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java
  2. 36
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java
  4. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseRequisitioningOrderVo.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java
  6. 143
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java
  7. 7
      ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml
  8. 26
      ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml
  9. 135
      ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html
  10. 37
      ruoyi-admin/src/main/resources/templates/system/requisitioning/detail.html
  11. 118
      ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html
  12. 107
      ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html
  13. 58
      ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html
  14. 55
      ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html
  15. 56
      ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html
  16. 136
      ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html

24
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.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.purchase.service.IPurchasePlanService; import com.ruoyi.purchase.service.IPurchasePlanService;
import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo; import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo;
import com.ruoyi.system.mapper.*; import com.ruoyi.system.mapper.*;
import com.ruoyi.system.service.*; import com.ruoyi.system.service.*;
@ -93,6 +94,9 @@ public class BaseRequisitioningOrderController extends BaseController
@Autowired @Autowired
private IPurchasePlanService purchasePlanService; private IPurchasePlanService purchasePlanService;
@Autowired
private IBaseExpenseAccountService baseExpenseAccountService;
@RequiresPermissions("system:requisitioning:view") @RequiresPermissions("system:requisitioning:view")
@GetMapping() @GetMapping()
public String requisitioning() public String requisitioning()
@ -106,8 +110,7 @@ public class BaseRequisitioningOrderController extends BaseController
@RequiresPermissions("system:requisitioning:list") @RequiresPermissions("system:requisitioning:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(BaseRequisitioningOrderVo baseRequisitioningOrder) public TableDataInfo list(BaseRequisitioningOrderVo baseRequisitioningOrder) throws Exception {
{
startPage(); startPage();
List<BaseRequisitioningOrderVo> list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); List<BaseRequisitioningOrderVo> list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder);
return getDataTable(list); return getDataTable(list);
@ -120,8 +123,7 @@ public class BaseRequisitioningOrderController extends BaseController
@Log(title = "请购单", businessType = BusinessType.EXPORT) @Log(title = "请购单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(BaseRequisitioningOrderVo baseRequisitioningOrder) public AjaxResult export(BaseRequisitioningOrderVo baseRequisitioningOrder) throws Exception {
{
List<BaseRequisitioningOrderVo> list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); List<BaseRequisitioningOrderVo> list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder);
ExcelUtil<BaseRequisitioningOrderVo> util = new ExcelUtil<BaseRequisitioningOrderVo>(BaseRequisitioningOrderVo.class); ExcelUtil<BaseRequisitioningOrderVo> util = new ExcelUtil<BaseRequisitioningOrderVo>(BaseRequisitioningOrderVo.class);
return util.exportExcel(list, "请购单数据"); return util.exportExcel(list, "请购单数据");
@ -296,6 +298,7 @@ public class BaseRequisitioningOrderController extends BaseController
if (processIsFinish) { if (processIsFinish) {
// 审核通过 // 审核通过
baseRequisitioningOrderVo.setAuditStatus("1"); baseRequisitioningOrderVo.setAuditStatus("1");
baseRequisitioningOrderVo.setRequisitioningStatus("0");//待采购
//查通过的审核订单 //查通过的审核订单
BaseRequisitioningOrder baseRequisitioningOrder = baseRequisitioningOrderService.selectBaseRequisitioningOrderById(baseRequisitioningOrderVo.getRequisitioningId()); BaseRequisitioningOrder baseRequisitioningOrder = baseRequisitioningOrderService.selectBaseRequisitioningOrderById(baseRequisitioningOrderVo.getRequisitioningId());
baseRequisitioningOrder.setRequisitioningId(baseRequisitioningOrderVo.getRequisitioningId()); baseRequisitioningOrder.setRequisitioningId(baseRequisitioningOrderVo.getRequisitioningId());
@ -330,4 +333,17 @@ public class BaseRequisitioningOrderController extends BaseController
public Result getId(HttpServletRequest request) throws Exception { public Result getId(HttpServletRequest request) throws Exception {
return Result.getSuccessResult(baseRequisitioningOrderService.getId()); return Result.getSuccessResult(baseRequisitioningOrderService.getId());
} }
@GetMapping("/getBinessMembers")
@ResponseBody
public TableDataInfo getBusinessMembers(){
startPage();
List<SysUser> 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);
}
} }

36
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java

@ -48,14 +48,22 @@ public class BaseRequisitioningOrder extends BaseEntity
@Excel(name = "数量总计") @Excel(name = "数量总计")
private Long materialSum; private Long materialSum;
// 料号(用以搜索框关联子表搜索)
private String materialCode;
// 物料名称
private String materialName;
/** 不含税总价(RMB) */ /** 不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)") @Excel(name = "不含税总价(RMB)")
private BigDecimal noRmbSum; private BigDecimal noRmbSum;
/** 含税总价合计(RMB) */ /** 预估总价(RMB) */
@Excel(name = "含税总价合计(RMB)") @Excel(name = "预估总价(RMB)")
private BigDecimal rmbSum; private BigDecimal rmbSum;
private BigDecimal estimatePrice;
/** 申请人 */ /** 申请人 */
@Excel(name = "申请人") @Excel(name = "申请人")
private String applyUser; private String applyUser;
@ -293,6 +301,30 @@ public class BaseRequisitioningOrder extends BaseEntity
return useStatus; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

11
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java

@ -52,6 +52,9 @@ public class BaseRequisitioningOrderChild extends BaseEntity
@Excel(name = "物料的规格") @Excel(name = "物料的规格")
private String specifications; private String specifications;
// 加工方式
private String processMethod;
/** 物料的品牌 */ /** 物料的品牌 */
@Excel(name = "物料的品牌") @Excel(name = "物料的品牌")
private String brand; private String brand;
@ -286,6 +289,14 @@ public class BaseRequisitioningOrderChild extends BaseEntity
return auditStatus; return auditStatus;
} }
public String getProcessMethod() {
return processMethod;
}
public void setProcessMethod(String processMethod) {
this.processMethod = processMethod;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

11
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 taskId;
/** 任务名称 */ /** 任务名称 */
private String taskName; private String taskName;
// 任务状态
private String taskStatus;
/** 办理时间 */ /** 办理时间 */
private Date doneTime; private Date doneTime;
/** 创建人 */ /** 创建人 */
@ -106,6 +109,14 @@ public class BaseRequisitioningOrderVo extends BaseRequisitioningOrder {
this.keyword = keyword; this.keyword = keyword;
} }
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
@Override @Override
public String toString() { public String toString() {
return "ErpMaterialVo{" + return "ErpMaterialVo{" +

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java

@ -30,7 +30,7 @@ public interface IBaseRequisitioningOrderService
* @return 请购单集合 * @return 请购单集合
*/ */
List<BaseRequisitioningOrderVo> selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo); List<BaseRequisitioningOrderVo> selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo) throws Exception;
/** /**
* 新增请购单 * 新增请购单

143
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.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import com.github.pagehelper.Page; 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.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.service.ICommonService; import com.ruoyi.common.service.ICommonService;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; 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.domain.Vo.BaseRequisitioningOrderVo;
import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper; import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService; import com.ruoyi.system.service.*;
import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysRoleService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
@ -37,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper; import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper;
import com.ruoyi.system.domain.BaseRequisitioningOrder; import com.ruoyi.system.domain.BaseRequisitioningOrder;
import com.ruoyi.system.service.IBaseRequisitioningOrderService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -93,6 +94,9 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
@Autowired @Autowired
private IPurchasePlanService purchasePlanService; private IPurchasePlanService purchasePlanService;
@Autowired
private IBaseExpenseAccountService baseExpenseAccountService;
/** /**
* 查询请购单 * 查询请购单
* *
@ -119,13 +123,27 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
* @return 请购单 * @return 请购单
*/ */
@Override @Override
public List<BaseRequisitioningOrderVo> selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo1) public List<BaseRequisitioningOrderVo> selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo1) throws Exception {
{ SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
List<BaseRequisitioningOrderVo> Volist = baseRequisitioningOrderMapper.selectBaseRequisitioningOrderList(baseRequisitioningOrderVo1);
// 获取当前登录名下可看用户列表
Set<String> users = baseExpenseAccountService.userLimitedList(roleKeys,curUser);
List<BaseRequisitioningOrderVo> matchedList = Volist.stream()
.filter(requisitioningOrderVo -> users.contains(requisitioningOrderVo.getApplyUser()))
.collect(Collectors.toList());
PageDomain pageDomain = TableSupport.buildPageRequest(); PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum(); Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize(); Integer pageSize = pageDomain.getPageSize();
PageHelper.startPage(pageNum, pageSize);
//PageHelper 仅对第一List分页有效 //PageHelper 仅对第一List分页有效
Page<BaseRequisitioningOrderVo> list = (Page<BaseRequisitioningOrderVo>) baseRequisitioningOrderMapper.selectBaseRequisitioningOrderList(baseRequisitioningOrderVo1); PageInfo<BaseRequisitioningOrderVo> pageInfo = new PageInfo<>(matchedList);
// Page<BaseRequisitioningOrderVo> list = (Page<BaseRequisitioningOrderVo>) pageInfo.getList();
List<BaseRequisitioningOrderVo> list = pageInfo.getList();
Page<BaseRequisitioningOrderVo> returnList = new Page<>(); Page<BaseRequisitioningOrderVo> returnList = new Page<>();
for(BaseRequisitioningOrderVo baseRequisitioningOrderVo : list){ for(BaseRequisitioningOrderVo baseRequisitioningOrderVo : list){
SysUser sysUser = userMapper.selectUserByLoginName(baseRequisitioningOrderVo.getCreateBy()); SysUser sysUser = userMapper.selectUserByLoginName(baseRequisitioningOrderVo.getCreateBy());
@ -166,9 +184,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
} else { } else {
baseRequisitioningOrderVo.setTaskName("未启动"); 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.add(baseRequisitioningOrderVo);
} }
returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.size());
returnList.setPageNum(pageNum); returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize); returnList.setPageSize(pageSize);
return returnList; return returnList;
@ -181,45 +205,51 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional(rollbackFor = NullPointerException.class) @Transactional(rollbackFor = Exception.class)
public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder)
{ {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
baseRequisitioningOrder.setCreateBy(loginName); baseRequisitioningOrder.setCreateBy(loginName);
baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate()); baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate());
if (baseRequisitioningOrder.getRequisitioningCode() == null) { baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
}
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList();
Long materialSum = 0L; Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0); 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(); Integer childSize = childList.size();
if (childSize > 0) { for (BaseRequisitioningOrderChild child : childList) {
for (BaseRequisitioningOrderChild child : childList) { //物料数量
//物料数量 if(child.getMaterialNum() == null){
materialSum += child.getMaterialNum(); throw new BusinessException("存在物料数为空,请检查");
if (child.getMaterialRmbSum() == null){ }
child.setMaterialRmbSum(new BigDecimal(0)); materialSum += child.getMaterialNum();
} if (child.getMaterialRmbSum() == null){
if (child.getMaterialNoRmbSum() == null){ child.setMaterialRmbSum(new BigDecimal(0));
child.setMaterialNoRmbSum(new BigDecimal(0)); }
} if(child.getMaterialRmb() == null){
//物料不含税总价(RMB) throw new BusinessException("存在预估金额为空,请检查");
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);
} }
//物料预估总价(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.setMaterialAmount(childSize);
baseRequisitioningOrder.setMaterialSum(materialSum); baseRequisitioningOrder.setMaterialSum(materialSum);
baseRequisitioningOrder.setRmbSum(materialRmbSum); baseRequisitioningOrder.setRmbSum(materialRmbSum);
baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); baseRequisitioningOrder.setEstimatePrice(estimatePrice);
// baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum);
int result = baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder); int result = baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder);
//如要获取请购单ID,作为key //如要获取请购单ID,作为key
baseRequisitioningOrder.getRequisitioningId(); baseRequisitioningOrder.getRequisitioningId();
@ -233,7 +263,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional(rollbackFor = NullPointerException.class) @Transactional(rollbackFor = Exception.class)
public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder)
{ {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
@ -243,14 +273,29 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList();
Long materialSum = 0L; Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0); BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0); // BigDecimal materialNoRmbSum = new BigDecimal(0);
// 物料预估单价合计
BigDecimal estimatePrice = new BigDecimal(0);
// Integer childSize = childList.size(); // Integer childSize = childList.size();
if (!StringUtils.isEmpty(childList)) { if (!StringUtils.isEmpty(childList)) {
baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByRequisitioningCode(baseRequisitioningOrder.getRequisitioningCode()); baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByRequisitioningCode(baseRequisitioningOrder.getRequisitioningCode());
for (BaseRequisitioningOrderChild child: childList) { for (BaseRequisitioningOrderChild child: childList) {
//物料数量
if(child.getMaterialNum() == null){
throw new BusinessException("存在物料数为空,请检查");
}
materialSum += child.getMaterialNum(); materialSum += child.getMaterialNum();
materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); if (child.getMaterialRmbSum() == null){
materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); 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.setRequisitioningCode(requisitioningCode);
child.setCreateBy(loginName); child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate()); child.setCreateTime(DateUtils.getNowDate());
@ -262,12 +307,13 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
} }
baseRequisitioningOrder.setMaterialSum(materialSum); baseRequisitioningOrder.setMaterialSum(materialSum);
baseRequisitioningOrder.setRmbSum(materialRmbSum); baseRequisitioningOrder.setRmbSum(materialRmbSum);
baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); baseRequisitioningOrder.setEstimatePrice(estimatePrice);
// baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum);
return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder); return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder);
} }
@Override @Override
@Transactional(rollbackFor = NullPointerException.class) @Transactional(rollbackFor = Exception.class)
public int updateVerifyBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) { public int updateVerifyBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) {
baseRequisitioningOrder.setUpdateBy(ShiroUtils.getLoginName()); baseRequisitioningOrder.setUpdateBy(ShiroUtils.getLoginName());
baseRequisitioningOrder.setUpdateTime(DateUtils.getNowDate()); baseRequisitioningOrder.setUpdateTime(DateUtils.getNowDate());
@ -461,8 +507,8 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
} }
private void buildAuthority(SysUser user, Map<String, Object> variables) { private void buildAuthority(SysUser user, Map<String, Object> variables) {
System.out.println("请购单启动流程"); // System.out.println("请购单启动流程");
System.out.println("user = " + user + ", variables = " + variables); // System.out.println("user = " + user + ", variables = " + variables);
//查询当前请购人的角色 //查询当前请购人的角色
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId()); Set<String> 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")){ else if (roleKeys.contains("scyRole") || roleKeys.contains("scjlRole") || roleKeys.contains("sczgRole")){
// 生产经理 // 生产经理
variables.put("qgjlRole","scjlRoe"); variables.put("qgjlRole","scjlRole");
// 生产主管 // 生产主管
variables.put("qgzgRole","sczgRole"); variables.put("qgzgRole","sczgRole");
} }
@ -498,15 +544,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
// 售后主管 // 售后主管
variables.put("qgzgRole","shzgRole"); variables.put("qgzgRole","shzgRole");
} }
else if(roleKeys.contains("cgyyRole") || roleKeys.contains("ckzgRole")){ else if(roleKeys.contains("cgyyRole") || roleKeys.contains("cgzgRole")){
variables.put("qgjlRole","shzgRole"); // 仓管员、仓管主管
// 售后主管 variables.put("qgjlRole","cgzgRole");
variables.put("qgzgRole","shzgRole");
variables.put("qgzgRole","cgzgRole");
} }
else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")){ else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")){
variables.put("qgjlRole","cwjlRole"); variables.put("qgjlRole","cwjlRole");
// 售后主管 // 财务
variables.put("qgzgRole","cwJlRole");
} }
else{ else{
variables.put("authority",2); variables.put("authority",2);
@ -547,11 +593,12 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
purchasePlanChild.setBrand(requisitioningOrderDetail.getBrand()); purchasePlanChild.setBrand(requisitioningOrderDetail.getBrand());
purchasePlanChild.setUnit(requisitioningOrderDetail.getUnit()); purchasePlanChild.setUnit(requisitioningOrderDetail.getUnit());
purchasePlanChild.setPhotoUrl(requisitioningOrderDetail.getPhotoUrl()); purchasePlanChild.setPhotoUrl(requisitioningOrderDetail.getPhotoUrl());
purchasePlanChild.setProcessMethod(requisitioningOrderDetail.getProcessMethod());
purchasePlanChild.setMaterialNum(Double.valueOf(requisitioningOrderDetail.getMaterialNum())); purchasePlanChild.setMaterialNum(Double.valueOf(requisitioningOrderDetail.getMaterialNum()));
purchasePlanChild.setMaterialType(requisitioningOrderDetail.getMaterialType()); purchasePlanChild.setMaterialType(requisitioningOrderDetail.getMaterialType());
purchasePlanChild.setMaterialNoRmb(requisitioningOrderDetail.getMaterialNoRmb()); purchasePlanChild.setMaterialNoRmb(requisitioningOrderDetail.getMaterialNoRmb());
purchasePlanChild.setMaterialRmb(requisitioningOrderDetail.getMaterialRmb()); purchasePlanChild.setMaterialRmb(requisitioningOrderDetail.getMaterialRmb());
noRmbSum = noRmbSum.add(requisitioningOrderDetail.getMaterialNoRmb()); // noRmbSum = noRmbSum.add(requisitioningOrderDetail.getMaterialNoRmb());
rmbSum = rmbSum.add(requisitioningOrderDetail.getMaterialRmbSum()); rmbSum = rmbSum.add(requisitioningOrderDetail.getMaterialRmbSum());
materialSum += requisitioningOrderDetail.getMaterialNum(); materialSum += requisitioningOrderDetail.getMaterialNum();
planChildMapper.insertPurchasePlanChild(purchasePlanChild); planChildMapper.insertPurchasePlanChild(purchasePlanChild);

7
ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml

@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="specifications" column="specifications" /> <result property="specifications" column="specifications" />
<result property="brand" column="brand" /> <result property="brand" column="brand" />
<result property="describe" column="describe" /> <result property="describe" column="describe" />
<result property="processMethod" column="process_method" />
<result property="warehouseDept" column="warehouseDept" />
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="materialNum" column="materialNum" /> <result property="materialNum" column="materialNum" />
<result property="materialRmb" column="materialRmb" /> <result property="materialRmb" column="materialRmb" />
@ -34,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectBaseRequisitioningOrderChildVo"> <sql id="selectBaseRequisitioningOrderChildVo">
select requisitioning_child_id, requisitioning_code, material_id, material_code, photoUrl, 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, `describe`, materialNum, materialRmb, materialNoRmb, materialNoRmbSum, materialRmbSum, remark,
create_by, create_time, update_by, update_time, use_status, audit_status,del_flag create_by, create_time, update_by, update_time, use_status, audit_status,del_flag
from base_requisitioning_order_child from base_requisitioning_order_child
@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null">material_type,</if> <if test="materialType != null">material_type,</if>
<if test="materialModel != null">material_model,</if> <if test="materialModel != null">material_model,</if>
<if test="specifications != null">specifications,</if> <if test="specifications != null">specifications,</if>
<if test="processMethod != null">process_method,</if>
<if test="brand != null">brand,</if> <if test="brand != null">brand,</if>
<if test="unit != null">unit,</if> <if test="unit != null">unit,</if>
<if test="warehouseDept != null">warehouseDept,</if> <if test="warehouseDept != null">warehouseDept,</if>
@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null">#{materialType},</if> <if test="materialType != null">#{materialType},</if>
<if test="materialModel != null">#{materialModel},</if> <if test="materialModel != null">#{materialModel},</if>
<if test="specifications != null">#{specifications},</if> <if test="specifications != null">#{specifications},</if>
<if test="processMethod != null">#{processMethod},</if>
<if test="brand != null">#{brand},</if> <if test="brand != null">#{brand},</if>
<if test="unit != null">#{unit},</if> <if test="unit != null">#{unit},</if>
<if test="warehouseDept != null">#{warehouseDept},</if> <if test="warehouseDept != null">#{warehouseDept},</if>
@ -151,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
<if test="materialModel != null">material_model = #{materialModel},</if> <if test="materialModel != null">material_model = #{materialModel},</if>
<if test="specifications != null">specifications = #{specifications},</if> <if test="specifications != null">specifications = #{specifications},</if>
<if test="processMethod != null">process_method = #{processMethod},</if>
<if test="brand != null">brand = #{brand},</if> <if test="brand != null">brand = #{brand},</if>
<if test="unit != null">unit = #{unit},</if> <if test="unit != null">unit = #{unit},</if>
<if test="warehouseDept != null">warehouseDept = #{warehouseDept},</if> <if test="warehouseDept != null">warehouseDept = #{warehouseDept},</if>

26
ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml

@ -11,7 +11,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="correlationCode" column="correlation_code" /> <result property="correlationCode" column="correlation_code" />
<result property="materialAmount" column="material_amount" /> <result property="materialAmount" column="material_amount" />
<result property="materialSum" column="materialSum" /> <result property="materialSum" column="materialSum" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="noRmbSum" column="noRmbSum" /> <result property="noRmbSum" column="noRmbSum" />
<result property="estimatePrice" column="estimate_price" />
<result property="rmbSum" column="rmbSum" /> <result property="rmbSum" column="rmbSum" />
<result property="applyUser" column="apply_user" /> <result property="applyUser" column="apply_user" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
@ -35,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectBaseRequisitioningOrderVo"> <sql id="selectBaseRequisitioningOrderVo">
select requisitioning_id, audit_status, requisitioning_status, requisitioning_code, 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, create_by, create_time, update_by, update_time, remark, use_status,
instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id,
apply_title, apply_user, apply_time, dept_name, post_name apply_title, apply_user, apply_time, dept_name, post_name
@ -44,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseRequisitioningOrderList" parameterType="BaseRequisitioningOrder" resultMap="BaseRequisitioningOrderResult"> <select id="selectBaseRequisitioningOrderList" parameterType="BaseRequisitioningOrder" resultMap="BaseRequisitioningOrderResult">
select r.requisitioning_id, r.requisitioning_status, r.requisitioning_code, select r.requisitioning_id, r.requisitioning_status, r.requisitioning_code,
r.correlation_code, r.material_amount, r.materialSum, r.noRmbSum, r.rmbSum,r.create_by, r.correlation_code, r.material_amount, r.materialSum, r.noRmbSum, r.estimate_price, r.rmbSum,r.create_by,
r.create_time,r.update_by, r.update_time, r.remark,r.instance_id, p.dict_value as instance_type_name, r.create_time,r.update_by, r.update_time, r.remark,r.instance_id, p.dict_value as instance_type_name,
r.instance_type,r.submit_instance_id, r.cancel_instance_id, r.instance_type,r.submit_instance_id, r.cancel_instance_id,
r.restore_instance_id, r.apply_title, r.apply_user, r.apply_time,r.apply_user, r.restore_instance_id, r.apply_title, r.apply_user, r.apply_time,r.apply_user,
@ -58,21 +61,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
r.del_flag = '0' r.del_flag = '0'
<if test="requisitioningId != null and requisitioningId != ''"> and r.requisitioning_id = #{requisitioningId}</if> <if test="requisitioningId != null and requisitioningId != ''"> and r.requisitioning_id = #{requisitioningId}</if>
<if test="requisitioningStatus != null and requisitioningStatus != ''"> and r.requisitioning_status = #{requisitioningStatus}</if> <if test="requisitioningStatus != null and requisitioningStatus != ''"> and r.requisitioning_status = #{requisitioningStatus}</if>
<if test="requisitioningCode != null and requisitioningCode != ''"> and r.requisitioning_code = #{requisitioningCode}</if> <if test="requisitioningCode != null and requisitioningCode != ''"> and r.requisitioning_code like concat('%', #{requisitioningCode}, '%')</if>
<if test="correlationCode != null and correlationCode != ''"> and r.correlation_code like concat('%', #{correlationCode}, '%')</if>
<if test="auditStatus!= null and auditStatus != ''"> and r.audit_status = #{auditStatus}</if> <if test="auditStatus!= null and auditStatus != ''"> and r.audit_status = #{auditStatus}</if>
<if test="useStatus!= null and useStatus != ''"> and r.use_status = #{useStatus}</if> <if test="useStatus!= null and useStatus != ''"> and r.use_status = #{useStatus}</if>
<if test="instanceId != null and instanceId != ''"> and r.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and r.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and r.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and r.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and r.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and r.apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and r.apply_user = #{applyUser}</if> <if test="applyUser != null and applyUser != ''"> and r.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and r.apply_time = #{applyTime}</if> <if test="applyTime != null "> and r.apply_time = #{applyTime}</if>
<if test="createBy != null and createBy != ''"> and r.create_by = #{createBy}</if> <if test="createBy != null and createBy != ''"> and r.create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and r.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and r.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="materialCode != null and materialCode != ''">
and requisitioning_code in ( select requisitioning_code from base_requisitioning_order_child where material_code like concat('%', #{materialCode}, '%'))
</if>
<if test="materialName != null and materialName != ''">
and requisitioning_code in ( select requisitioning_code from base_requisitioning_order_child where material_name like concat('%', #{materialName}, '%'))
</if>
<!-- <if test="params.materialCode != null and params.materialCode != '' or params.materialName !=null and params.materialName != ''">--> <!-- <if test="params.materialCode != null and params.materialCode != '' or params.materialName !=null and params.materialName != ''">-->
<!-- and r.requisitioning_code in (--> <!-- and r.requisitioning_code in (-->
<!-- select requisitioning_code from base_requisitioning_order_child--> <!-- select requisitioning_code from base_requisitioning_order_child-->
@ -87,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- )--> <!-- )-->
<!-- </if>--> <!-- </if>-->
</where> </where>
order by audit_status asc, create_time desc
</select> </select>
<select id="selectBaseRequisitioningOrderById" parameterType="Long" resultMap="BaseRequisitioningOrderResult"> <select id="selectBaseRequisitioningOrderById" parameterType="Long" resultMap="BaseRequisitioningOrderResult">
@ -109,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialAmount != null">material_amount,</if> <if test="materialAmount != null">material_amount,</if>
<if test="materialSum != null">materialSum,</if> <if test="materialSum != null">materialSum,</if>
<if test="noRmbSum != null">noRmbSum,</if> <if test="noRmbSum != null">noRmbSum,</if>
<if test="estimatePrice != null">estimate_price,</if>
<if test="rmbSum != null">rmbSum,</if> <if test="rmbSum != null">rmbSum,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -136,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialAmount != null">#{materialAmount},</if> <if test="materialAmount != null">#{materialAmount},</if>
<if test="materialSum != null">#{materialSum},</if> <if test="materialSum != null">#{materialSum},</if>
<if test="noRmbSum != null">#{noRmbSum},</if> <if test="noRmbSum != null">#{noRmbSum},</if>
<if test="estimatePrice != null">#{estimatePrice},</if>
<if test="rmbSum != null">#{rmbSum},</if> <if test="rmbSum != null">#{rmbSum},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -167,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialAmount != null">material_amount = #{materialAmount},</if> <if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="materialSum != null">materialSum = #{materialSum},</if> <if test="materialSum != null">materialSum = #{materialSum},</if>
<if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if> <if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if>
<if test="estimatePrice != null">estimate_price = #{estimatePrice},</if>
<if test="rmbSum != null">rmbSum = #{rmbSum},</if> <if test="rmbSum != null">rmbSum = #{rmbSum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>

135
ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html

@ -37,7 +37,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>选择采购物料</span>
<a class="btn btn-success" onclick="insertRow()"> <a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料 <i class="fa fa-plus"></i> 添加物料
</a> </a>
@ -67,14 +67,10 @@
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
pagination: false, pagination: false,
sidePagination: "client", sidePagination: "client",
model: "物料报价信息", showColumns: false,
model: "请购物料信息",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{field: 'materialIndex',align: 'center', title: "序号",
formatter: function (value, row, index) {
return index + 1;
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -88,8 +84,8 @@
return $.table.selectCategoryLabel(materialTypeDatas, value); return $.table.selectCategoryLabel(materialTypeDatas, value);
} }
}, },
{title: '型号',field: 'materialModel',align: 'center'}, {title: '型号',field: 'materialModel',visible: false,align: 'center'},
{title: '规格',field: 'specification',align: 'center'}, {title: '规格',field: 'specification',visible: false,align: 'center'},
{ title: '描述',field: 'describe',align: 'center'}, { title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', { title: '单位',field: 'unit',align: 'center',
@ -102,9 +98,11 @@
return $.table.selectDictLabel(processMethodDatas, value); return $.table.selectDictLabel(processMethodDatas, value);
} }
}, },
{title: '入库部门',field: 'warehouseDept',align: 'center',function(value, row, index) { {title: '入库部门',field: 'warehouseDept',align: 'center',
return $.table.selectDictLabel(warehouseDeptDatas, value); formatter: function(value, row, index) {
}}, return $.table.selectDictLabel(warehouseDeptDatas, value);
}
},
{title: '物料的数量', field: 'materialNum',align: 'center', {title: '物料的数量', field: 'materialNum',align: 'center',
editable : { editable : {
type : 'text', type : 'text',
@ -121,38 +119,44 @@
} }
} }
}}, }},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable : {
type : 'text', {title: '预估单价(RMB)', field: 'materialRmb', align: 'center',
mode:'inline', editable : {
title : '不含税单价',
validate : function(value) {
if (!value) {
return '用量不能为空';
}
if (isNaN(value)) {
return '用量必须为数字';
}else if(value < 0){
return "输入数值不能小于0";
}
}
}},
{title: '物料的含税单价(RMB)', field: 'materialRmb', align: 'center',editable : {
type : 'text', type : 'text',
mode:'inline', mode:'inline',
title : '含税单价', title : '预估单价',
validate : function(value) { validate : function(value) {
if (!value) { if (!value) {
return '用量不能为空'; return '金额不能为空';
} }
if (isNaN(value)) { if (isNaN(value)) {
return '用量必须为数字'; return '金额必须为数字';
}else if(value < 0){ }else if(value < 0){
return "输入数值不能小于0"; return "输入数值不能小于0";
} }
} }
}}, }
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, },
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center',
},
// {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',visible: false,
// editable : {
// type : 'text',
// mode:'inline',
// title : '不含税单价',
// validate : function(value) {
// if (!value) {
// return '用量不能为空';
// }
// if (isNaN(value)) {
// return '用量必须为数字';
// }else if(value < 0){
// return "输入数值不能小于0";
// }
// }
// }},
// {title: '物料的不含税总价(RMB)',
// visible: false,field: 'materialNoRmbSum',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},
@ -161,20 +165,19 @@
{title: '操作', align: 'center', {title: '操作', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialIndex + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join(''); return actions.join('');
} }
} }
], ],
onEditableSave: function (field, row, oldValue, $el) { onEditableSave: function (field, row, oldValue, $el) {
row.materialNoRmbSum = row.materialNum * row.materialNoRmb; // row.materialNoRmbSum = row.materialNum * row.materialNoRmb;
row.materialRmbSum = row.materialNum * row.materialRmb; // row.materialRmbSum = row.materialNum * row.materialRmb;
row.materialRmbSum = (row.materialNum * row.materialRmb).toFixed(2);
} }
}; };
$.table.init(options); $.table.init(options);
getRequisitionNo();
getSelections(); getSelections();
}); });
//生成请购单号 //生成请购单号
@ -198,19 +201,29 @@
} }
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')[0]; var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
var rows = $("#bootstrap-sub-table-requisitionChild").bootstrapTable('getData').length; //判断是否重复
for(var i=0;i<rows;i++){ var data = $("#bootstrap-sub-table-requisitionChild").bootstrapTable('getData');
var data = $("#bootstrap-sub-table-requisitionChild").bootstrapTable('getData')[i]; var rows = data.length;
if(data.materialCode==rowData.materialNo){ if(rows>0){
$.modal.alertError("不能选择已添加过的相同料号"); for(var i=0;i<rows;i++){
return; for(var j=0;j<rowData.length;j++){
} if(data[i].materialCode===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
rowData.split(j,1);
break;
}
}
};
}
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
} }
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('insertRow', { layer.close(index);
index:1, }
row: { function insertTable(rowData){
materialId:rowData.id, newRow = {
materialId:rowData.id,
materialCode: rowData.materialNo, materialCode: rowData.materialNo,
materialName: rowData.materialName, materialName: rowData.materialName,
materialType: rowData.materialType, materialType: rowData.materialType,
@ -220,15 +233,12 @@
processMethod: rowData.processMethod, processMethod: rowData.processMethod,
warehouseDept:rowData.warehouseDept, warehouseDept:rowData.warehouseDept,
photoUrl: rowData.photoUrl, photoUrl: rowData.photoUrl,
materialNum: 1, materialNum: "",
materialRmb: rowData.materialRmb, materialRmb: "",
materialNoRmb: rowData.materialNoRmb, materialRmbSum: "",
materialNoRmbSum: rowData.materialNoRmbSum,
materialRmbSum: rowData.materialRmbSum,
remark: "" remark: ""
} }
}) $("#bootstrap-sub-table-requisitionChild").bootstrapTable('append', newRow);
layer.close(index);
} }
function insertRow() { function insertRow() {
var url = ctx + "erp/material/select"; var url = ctx + "erp/material/select";
@ -240,10 +250,10 @@
$.modal.openOptions(options); $.modal.openOptions(options);
} }
/* 删除指定表格行 */ /* 删除指定表格行 */
function removeRow(materialIndex){ function removeRow(materialCode){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', { $("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', {
field: 'materialIndex', field: 'materialCode',
values: materialIndex values: materialCode
}) })
} }
function submitHandler() { function submitHandler() {
@ -259,6 +269,7 @@
}else{ }else{
formData.push({"name": "baseRequisitioningOrderChildList", "value": tableData}); formData.push({"name": "baseRequisitioningOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData); var jsonData = $.common.formDataToJson(formData);
console.log(jsonData);
$.operate.saveJson(prefix + "/add", jsonData); $.operate.saveJson(prefix + "/add", jsonData);
} }
} }

37
ruoyi-admin/src/main/resources/templates/system/requisitioning/detail.html

@ -18,19 +18,19 @@
<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">
<select name="deptName" th:field="*{deptName}" class="form-control"></select> <select disabled name="deptName" th:field="*{deptName}" class="form-control"></select>
</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">
<select name="postName" th:field="*{postName}" class="form-control"></select> <select disabled name="postName" th:field="*{postName}" class="form-control"></select>
</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">
<select name="userName" th:field="*{userName}" class="form-control"></select> <select disabled name="userName" th:field="*{userName}" class="form-control"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -43,7 +43,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span> <span>物料信息</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -62,6 +62,7 @@
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var prefix = ctx + "system/requisitioning"; var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-detail").validate({focusCleanup: true}); $("#form-requisitioning-detail").validate({focusCleanup: true});
$(function() { $(function() {
@ -72,15 +73,8 @@
pagination: false, pagination: false,
sidePagination: "client", sidePagination: "client",
queryParams:queryParams, queryParams:queryParams,
model: "物料报价信息", model: "物料信息",
columns: [ columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -94,23 +88,28 @@
return $.table.selectCategoryLabel(materialTypeDatas, value); return $.table.selectCategoryLabel(materialTypeDatas, value);
} }
}, },
{ title: '描述',field: 'describe',align: 'center'}, {title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', {title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value); return $.table.selectDictLabel(sysUnitClassDatas, value);
} }
}, },
{title: '半成品类型',field: 'processMethod',align: 'center', {title: '加工方式',field: 'processMethod',align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value); 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: '物料的数量', field: 'materialNum',align: 'center'},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '物料的不含税单价(RMB)',visible: false,field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, {title: '物料的含税总价(RMB)',visible: false,field: 'materialNoRmbSum',align: 'center',},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, {title: '预估总价(RMB)',field: 'materialRmbSum',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},

118
ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html

@ -44,7 +44,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>请购物料信息</span>
<a class="btn btn-success" onclick="insertRow()"> <a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料 <i class="fa fa-plus"></i> 添加物料
</a> </a>
@ -78,15 +78,8 @@
pagination: false, pagination: false,
sidePagination: "client", sidePagination: "client",
queryParams:queryParams, queryParams:queryParams,
model: "物料报价信息", model: "请购物料信息",
columns: [ columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -107,16 +100,36 @@
return $.table.selectDictLabel(sysUnitClassDatas, value); return $.table.selectDictLabel(sysUnitClassDatas, value);
} }
}, },
{title: '半成品类型',field: 'processMethod',align: 'center', {title: '加工方式',field: 'processMethod',align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value); 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: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '预估单价(RMB)', field: 'materialRmb', align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, editable : {
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, type : 'text',
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, 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: '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},
@ -125,15 +138,16 @@
{title: '操作', align: 'center', {title: '操作', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialId + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join(''); return actions.join('');
} }
} }
], ],
onEditableSave:function(field, row, oldValue, $el){ onEditableSave: function (field, row, oldValue, $el) {
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2); // row.materialNoRmbSum = row.materialNum * row.materialNoRmb;
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2); // row.materialRmbSum = row.materialNum * row.materialRmb;
}, row.materialRmbSum = (row.materialNum * row.materialRmb).toFixed(2);
}
}; };
$.table.init(options); $.table.init(options);
}); });
@ -147,32 +161,46 @@
return curParams; return curParams;
} }
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
console.log(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')[0]; var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
console.log("rowData: "+rowData); //判断是否重复
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('insertRow', { var data = $("#bootstrap-sub-table-requisitionChild").bootstrapTable('getData');
index:1, var rows = data.length;
row: { if(rows>0){
materialId:rowData.id, for(var i=0;i<rows;i++){
materialCode: rowData.materialNo, for(var j=0;j<rowData.length;j++){
materialName: rowData.materialName, if(data[i].materialCode===rowData[j].materialNo){
materialType: rowData.materialType, $.modal.alertError("不能选择已添加过的相同物料");
describe: rowData.describe, rowData.split(j,1);
brand: rowData.brand, break;
unit: rowData.unit, }
processMethod: rowData.processMethod, }
photoUrl: rowData.photoUrl, };
materialNum: "", }
materialRmb: "", for(i=0;i<rowData.length;i++){
materialNoRmb: "", insertTable(rowData[i]);
materialNoRmbSum: "", }
materialRmbSum: "",
remark: ""
}
})
layer.close(index); layer.close(index);
} }
function insertTable(rowData){
newRow = {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
warehouseDept:rowData.warehouseDept,
photoUrl: rowData.photoUrl,
materialNum: "",
materialRmb: "",
materialRmbSum: "",
remark: ""
}
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('append', newRow);
}
function insertRow() { function insertRow() {
var url = ctx + "erp/material/select"; var url = ctx + "erp/material/select";
var options = { var options = {
@ -183,10 +211,10 @@
$.modal.openOptions(options); $.modal.openOptions(options);
} }
/* 删除指定表格行 */ /* 删除指定表格行 */
function removeRow(id){ function removeRow(materialId){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', { $("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', {
field: 'id', field: 'materialId',
values: id values: materialId
}) })
} }
function submitHandler() { function submitHandler() {

107
ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html

@ -15,13 +15,17 @@
<label>请购单ID:</label> <label>请购单ID:</label>
<input type="text" name="requisitioningCode"/> <input type="text" name="requisitioningCode"/>
</li> </li>
<li>
<label>关联单号:</label>
<input type="text" name="correlationCode"/>
</li>
<li> <li>
<label>料号:</label> <label>料号:</label>
<input type="text" name="params[materialCode]"/> <input type="text" name="materialCode"/>
</li> </li>
<li> <li>
<label>物料名称:</label> <label>物料名称:</label>
<input type="text" name="params[materialName]"/> <input type="text" name="materialName"/>
</li> </li>
<li> <li>
<label>审核状态:</label> <label>审核状态:</label>
@ -38,14 +42,16 @@
</select> </select>
</li> </li>
<li> <li>
<label>请购人:</label> <label>申请人:</label>
<input type="text" name="createBy"/> <select name="createBy">
<option value="">所有</option>
</select>
</li> </li>
<li class="select-time"> <li class="select-time">
<label>录入时间: </label> <label>申请时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/> <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li> </li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -83,6 +89,22 @@
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "system/requisitioning"; var prefix = ctx + "system/requisitioning";
$(function() { $(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(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
@ -93,12 +115,15 @@
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}", detailUrl: prefix + "/detail/{id}",
modalName: "请购单", modalName: "请购单",
// pageList: [5, 10, 25, 50],
// pageSize: 10,
sortable: true, // 是否启用排序 sortable: true, // 是否启用排序
sortStable: true, // 设置为 true 将获得稳定的排序 sortStable: true, // 设置为 true 将获得稳定的排序
detailView: false, detailView: false,
fixedColumns: true, // 启用冻结列 fixedColumns: true, // 启用冻结列
rightFixedColumns:1, rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数 fixedRightNumber: 1, // 冻结右列个数
showFooter: true,
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '请购单索引id',field: 'requisitioningId',visible: false}, {title: '请购单索引id',field: 'requisitioningId',visible: false},
@ -108,6 +133,8 @@
{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},
{title: '请购单编号',field: 'requisitioningCode',},
{title: '关联单号',field: 'correlationCode',},
{ {
field: 'applyUserName', field: 'applyUserName',
title: '<span style="color: red;">申请人</span>', title: '<span style="color: red;">申请人</span>',
@ -115,33 +142,55 @@
return '<span style="color: red;">' + (value ? value : "-") + '</span>'; return '<span style="color: red;">' + (value ? value : "-") + '</span>';
} }
}, },
{field: 'applyTime',title: '申请时间' {title: '请购部门',field: 'deptName',},
},
{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},
{ title: '当前状态',field: 'taskStatus',
align: 'center', align: 'center',
formatter: function(value, row, index) { 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>'; return '<span class="badge badge-primary">' + value + '</span>';
} }
}, },
{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) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{title: '请购状态',field: 'requisitioningStatus', {title: '请购状态',field: 'requisitioningStatus',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(requisitioningStatusDatas, value); return $.table.selectDictLabel(requisitioningStatusDatas, value);
} }
}, },
{title: '请购单编号',field: 'requisitioningCode',}, {title: '请购人',field: 'createBy',visible: false},
{title: '关联单号',field: 'correlationCode',},
{title: '物料合计',field: 'materialAmount',},
{title: '数量总计',field: 'materialSum',},
{title: '不含税总价(RMB)',field: 'noRmbSum',},
{title: '含税总价合计(RMB)',field: 'rmbSum',},
{title: '请购人',field: 'createBy',},
{title: '备注',field: 'remark',}, {title: '备注',field: 'remark',},
{title: '操作',align: 'center', {title: '操作',align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
@ -149,13 +198,15 @@
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) { if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) {
// 作废 // 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.requisitioningId + '\')"><i class="fa fa-remove"></i> 作废</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.requisitioningId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisitioningId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废 // 已作废
} }
else{ else{
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> '); actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
} }
if(row.auditStatus == "2" && row.useStatus == "1"){
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisitioningId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id // 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){ if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复 // 恢复
@ -181,7 +232,15 @@
return actions.join(''); return actions.join('');
} }
} }
] ],
rowStyle: function (row, index) {
if (row.auditStatus=="0") {
// 如果审核状态为待审核,则设置为红色
return {css:{"color":"red"}};
}
// 否则使用默认样式
return {};
}
}; };
$.table.init(options); $.table.init(options);
}); });

58
ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html

@ -44,21 +44,21 @@
<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">
<select name="deptName" th:field="*{deptName}" class="form-control"></select> <input name="deptName" th:field="*{deptName}" class="form-control" disabled/>
</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">
<select name="postName" th:field="*{postName}" class="form-control"></select> <input name="postName" th:field="*{postName}" class="form-control" disabled/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="userName" th:field="*{userName}" class="form-control"></select>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">姓名:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="userName" th:field="*{userName}" class="form-control" disabled>-->
<!-- </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">
@ -85,7 +85,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>请购物料信息</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -123,16 +123,12 @@
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
url: ctx + "system/requisitioningChild/list", url: ctx + "system/requisitioningChild/list",
pagination: false, pagination: false,
showSearch: false,
showColumns: false,
sidePagination: "client", sidePagination: "client",
queryParams: queryParams, queryParams: queryParams,
model: "物料报价信息", model: "请购物料信息",
columns: [ 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: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -155,15 +151,31 @@
} }
}, },
{title: '入库部门',field: 'warehouseDept',align: 'center', {title: '入库部门',field: 'warehouseDept',align: 'center',
formatter: function(value, row, index) { formatter:function(value, row, index){
$.table.selectDictLabel(warehouseDeptDatas, value); return $.table.selectDictLabel(warehouseDeptDatas, value);
} }
}, },
{title: '物料的数量', field: 'materialNum',align: 'center',}, {title: '物料的数量', field: 'materialNum',align: 'center',},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, footerFormatter: function (value) {
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, var sum = 0;
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, 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: '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},

55
ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html

@ -44,21 +44,21 @@
<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">
<select name="deptName" th:field="*{deptName}" class="form-control" disabled></select> <input name="deptName" th:field="*{deptName}" class="form-control" disabled></input>
</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">
<select name="postName" th:field="*{postName}" class="form-control" disabled></select> <input name="postName" th:field="*{postName}" class="form-control" disabled></input>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="userName" th:field="*{userName}" class="form-control" disabled></select>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">姓名:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="userName" th:field="*{userName}" class="form-control" disabled></select>-->
<!-- </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">
@ -85,7 +85,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>请购物料信息</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -108,21 +108,18 @@
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
$("#form-requisitioning-qgjl-audit").validate({focusCleanup: true}); $("#form-requisitioning-qgjl-audit").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
url: ctx + "system/requisitioningChild/list", url: ctx + "system/requisitioningChild/list",
pagination: false, pagination: false,
showSearch: false,
showColumns: false,
sidePagination: "client", sidePagination: "client",
queryParams: queryParams, queryParams: queryParams,
model: "物料报价信息", model: "请购物料信息",
columns: [ 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: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -145,15 +142,31 @@
} }
}, },
{title: '入库部门',field: 'warehouseDept',align: 'center', {title: '入库部门',field: 'warehouseDept',align: 'center',
formatter: function(value, row, index) { formatter:function(value, row, index){
return $.table.selectDictLabel(warehouseDeptDatas, value); return $.table.selectDictLabel(warehouseDeptDatas, value);
} }
}, },
{title: '物料的数量', field: 'materialNum',align: 'center',}, {title: '物料的数量', field: 'materialNum',align: 'center',},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, footerFormatter: function (value) {
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, var sum = 0;
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, 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: '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},

56
ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html

@ -38,27 +38,27 @@
<div class="form-group" hidden="hidden"> <div class="form-group" hidden="hidden">
<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="code" th:field="*{requisitioningCode}" class="form-control" type="text"> <input disabled name="code" th:field="*{requisitioningCode}" class="form-control" type="text">
</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">
<select name="deptName" th:field="*{deptName}" class="form-control"></select> <input disabled name="deptName" th:field="*{deptName}" class="form-control"></input>
</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">
<select name="postName" th:field="*{postName}" class="form-control"></select> <input disabled name="postName" th:field="*{postName}" class="form-control"></input>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="userName" th:field="*{userName}" class="form-control"></select>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">姓名:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="userName" th:field="*{userName}" class="form-control"></select>-->
<!-- </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">
@ -85,7 +85,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>请购物料信息</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -114,16 +114,12 @@
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
url: ctx + "system/requisitioningChild/list", url: ctx + "system/requisitioningChild/list",
pagination: false, pagination: false,
showSearch: false,
showColumns: false,
sidePagination: "client", sidePagination: "client",
queryParams: queryParams, queryParams: queryParams,
model: "物料报价信息", model: "请购物料信息",
columns: [ 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: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
@ -146,15 +142,31 @@
} }
}, },
{title: '入库部门',field: 'warehouseDept',align: 'center', {title: '入库部门',field: 'warehouseDept',align: 'center',
formatter: function(value, row, index) { formatter:function(value, row, index){
return $.table.selectDictLabel(warehouseDeptDatas, value); return $.table.selectDictLabel(warehouseDeptDatas, value);
} }
}, },
{title: '物料的数量', field: 'materialNum',align: 'center',}, {title: '物料的数量', field: 'materialNum',align: 'center',},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, footerFormatter: function (value) {
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, var sum = 0;
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, 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: '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},

136
ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html

@ -44,21 +44,21 @@
<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">
<select name="deptName" th:field="*{deptName}" class="form-control"></select> <input name="deptName" th:field="*{deptName}" class="form-control"></input>
</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">
<select name="postName" th:field="*{postName}" class="form-control"></select> <input name="postName" th:field="*{postName}" class="form-control"></input>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="userName" th:field="*{userName}" class="form-control"></select>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">姓名:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="userName" th:field="*{userName}" class="form-control"></select>-->
<!-- </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">
@ -85,7 +85,7 @@
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>请购物料信息</span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -109,59 +109,71 @@
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
$("#form-requisitioning-zozj-audit").validate({focusCleanup: true}); $("#form-requisitioning-zozj-audit").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
url: ctx + "system/requisitioningChild/list", url: ctx + "system/requisitioningChild/list",
pagination: false, pagination: false,
sidePagination: "client", showSearch: false,
queryParams: queryParams, showColumns: false,
model: "物料报价信息", sidePagination: "client",
columns: [ queryParams: queryParams,
{checkbox: true}, model: "请购物料信息",
{field: 'index',align: 'center', title: "序号", columns: [
formatter: function (value, row, index,column) { {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
return $.table.serialNumber(index) - 1; {title: '料号',field: 'materialCode',align: 'center'},
} {title: '物料名称',field: 'materialName',align: 'center'},
}, {title: '图片',field: 'photoUrl',
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, formatter: function(value, row, index) {
{title: '料号',field: 'materialCode',align: 'center'}, return $.table.imageView(value);
{title: '物料名称',field: 'materialName',align: 'center'}, }
{title: '图片',field: 'photoUrl', },
formatter: function(value, row, index) { {title: '物料类型',field: 'materialType',align: 'center',
return $.table.imageView(value); formatter: function(value, row, index) {
} return $.table.selectCategoryLabel(materialTypeDatas, value);
}, }
{title: '物料类型',field: 'materialType',align: 'center', },
formatter: function(value, row, index) { { title: '描述',field: 'describe',align: 'center'},
return $.table.selectCategoryLabel(materialTypeDatas, value); {title: '品牌',field: 'brand',align: 'center'},
} { title: '单位',field: 'unit',align: 'center',},
}, {title: '加工方式',field: 'processMethod',align: 'center',
{ title: '描述',field: 'describe',align: 'center'}, formatter: function(value, row, index) {
{title: '品牌',field: 'brand',align: 'center'}, return $.table.selectDictLabel(processMethodDatas, value);
{ title: '单位',field: 'unit',align: 'center',}, }
{title: '加工方式',field: 'processMethod',align: 'center', },
formatter: function(value, row, index) { {title: '入库部门',field: 'warehouseDept',align: 'center',
return $.table.selectDictLabel(processMethodDatas, value); formatter:function(value, row, index){
} return $.table.selectDictLabel(warehouseDeptDatas, value);
}, }
{title: '入库部门',field: 'warehouseDept',align: 'center', },
formatter: function(value, row, index) { {title: '物料的数量', field: 'materialNum',align: 'center',},
return $.table.selectDictLabel(warehouseDeptDatas, value); {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',
} footerFormatter: function (value) {
}, var sum = 0;
{title: '物料的数量', field: 'materialNum',align: 'center',}, for (var i in value) {
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, sum += parseFloat(value[i].materialRmb) || 0;
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, }
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, return "总预估单价: " + sum.toFixed(2);
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, }
{title: '录入人',field: 'createBy',align: 'center',visible: false}, },
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center',
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, footerFormatter: function (value) {
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, var sum = 0;
{title: '备注',field: 'remark',align: 'center'}, for (var i in value) {
] sum += parseFloat(value[i].materialRmbSum) || 0;
}; }
$.table.init(options); 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) { function queryParams(params) {
var curParams = { var curParams = {

Loading…
Cancel
Save