Browse Source

[feat]

仓库管理 库存报损
修改库存报损列表页面表格定义,新增审批相关字段,设置列居中,设置行样式;
新增审批相关按钮,合并操作列按钮;
新增库存报损实体类审批相关字段;
修改库存报损vo类名称;
新增库存报损加载审批弹窗、绑定页面对象、完成任务controller方法;
新增库存报损更新审批信息、启动流程、创建提交审批流程、设置发起人变量service方法;
修改库存报损新增service方法,去除新增后更新库存查询记录语句;
新增库存报损mapper审批相关字段;
新增库存报损仓库主管、副总经理、调整申请页面;
dev
王晓迪 4 months ago
parent
commit
f7a3cd2eb4
  1. 138
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryReportDamageController.java
  2. 35
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/VO/WarehouseInventoryReportDamageVo.java
  3. 102
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/VO/WarehouseInventoryReportDamegeVo.java
  4. 42
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java
  5. 14
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryReportDamageMapper.java
  6. 22
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryReportDamageService.java
  7. 231
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryReportDamageServiceImpl.java
  8. 60
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml
  9. 32
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html
  10. 75
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/detail.html
  11. 126
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/inventoryReportDamage.html
  12. 221
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskCkzgVerify.html
  13. 221
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskFzjlVerify.html
  14. 426
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskModifyApply.html

138
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryReportDamageController.java

@ -1,21 +1,30 @@
package com.ruoyi.warehouse.controller;
import java.util.HashMap;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryCheckVO;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryReportDamageVo;
import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO;
import com.ruoyi.warehouse.domain.WarehouseInventoryCheckDetail;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild;
import com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageChildMapper;
import com.ruoyi.warehouse.service.IWarehouseInventoryReportDamageChildService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -32,6 +41,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 仓库库存报损Controller
@ -60,6 +70,15 @@ public class WarehouseInventoryReportDamageController extends BaseController
@Autowired
private WarehouseInventoryReportDamageChildMapper damageChildMapper;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@RequiresPermissions("warehouse:inventoryReportDamage:view")
@GetMapping()
public String inventoryReportDamage()
@ -73,10 +92,10 @@ public class WarehouseInventoryReportDamageController extends BaseController
@RequiresPermissions("warehouse:inventoryReportDamage:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public TableDataInfo list(WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo)
{
startPage();
List<WarehouseInventoryReportDamage> list = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage);
List<WarehouseInventoryReportDamageVo> list = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamageVo);
return getDataTable(list);
}
@ -118,9 +137,104 @@ public class WarehouseInventoryReportDamageController extends BaseController
@Log(title = "仓库库存报损", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@RequestBody WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public AjaxResult addSave(@RequestBody WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo)
{
return toAjax(warehouseInventoryReportDamageService.insertWarehouseInventoryReportDamage(warehouseInventoryReportDamage));
warehouseInventoryReportDamageVo.setAuditStatus("0");
warehouseInventoryReportDamageService.submitApply(warehouseInventoryReportDamageVo);
return AjaxResult.success();
}
/**
* 加载审批弹窗
* @param taskId
* @param mmap
* @return
*/
@GetMapping("/showVerifyDialog/{taskId}")
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
WarehouseInventoryReportDamageVo reportDamegeVo = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageById(new Long(processInstance.getBusinessKey()));
mmap.put("formData", reportDamegeVo);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public WarehouseInventoryReportDamageVo getObj(@RequestParam(value = "reportDamageId", required = false) Long reportDamageId, HttpSession session) {
if (reportDamageId != null) {
return warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageById(reportDamageId);
}
return new WarehouseInventoryReportDamageVo();
}
/**
* 完成任务
*
* @return
*/
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@RequestParam(value = "inventoryReportDamageChildList", required = false) String inventoryReportDamageChildList,
@ModelAttribute("preloadObj") WarehouseInventoryReportDamageVo reportDamageVo, HttpServletRequest request) {
reportDamageVo.setWarehouseInventoryReportDamageChildList(JSON.parseArray(inventoryReportDamageChildList, WarehouseInventoryReportDamageChild.class));
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = reportDamageVo.getInstanceId();
//获取实例类型
String instanceType = reportDamageVo.getInstanceType();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
if(verifyName.equals("ModifyApply")){
//驳回调整,设置为待审核
reportDamageVo.setAuditStatus("0");
reportDamageVo.setApplyTime(DateUtils.getNowDate());
}
boolean approvedFlag = processService.complete(taskId, instanceId, reportDamageVo.getApplyTitle(), reportDamageVo.getReportDamageCode(),
"reportDamage", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
reportDamageVo.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
reportDamageVo.setAuditStatus("1");
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
reportDamageVo.setUseStatus("1");
WarehouseInventoryReportDamageVo reportDamageVoData = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageById(reportDamageVo.getReportDamageId());
List<WarehouseInventoryReportDamageChild> damageChildren = reportDamageVoData.getWarehouseInventoryReportDamageChildList();
if(damageChildren!=null){
for (WarehouseInventoryReportDamageChild child:damageChildren) {
warehouseInventoryReportDamageService.updateWarehouseInventoryInquiry(child);
}
}
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
reportDamageVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
reportDamageVo.setUseStatus("1");
}
}
warehouseInventoryReportDamageService.updateVerify(reportDamageVo);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(reportDamageVo);
}
return success("任务已完成");
}
/**
@ -141,9 +255,9 @@ public class WarehouseInventoryReportDamageController extends BaseController
@Log(title = "仓库库存报损", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@RequestBody WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public AjaxResult editSave(@RequestBody WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo)
{
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage));
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamageVo));
}
@ -165,9 +279,9 @@ public class WarehouseInventoryReportDamageController extends BaseController
@Log(title = "仓库库存报损", businessType = BusinessType.UPDATE)
@PostMapping("/detail")
@ResponseBody
public AjaxResult detailSave(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public AjaxResult detailSave(WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo)
{
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage));
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamageVo));
}
@GetMapping("/getUserDeptName")

35
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/VO/WarehouseInventoryReportDamageVo.java

@ -0,0 +1,35 @@
package com.ruoyi.warehouse.domain.VO;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import lombok.Data;
import java.util.Date;
@Data
public class WarehouseInventoryReportDamageVo extends WarehouseInventoryReportDamage {
private static final long serialVersionUID = 1L;
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 当前状态 */
private String taskStatus;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
}

102
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/VO/WarehouseInventoryReportDamegeVo.java

@ -1,102 +0,0 @@
package com.ruoyi.warehouse.domain.VO;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import java.util.Date;
public class WarehouseInventoryReportDamegeVo extends WarehouseInventoryReportDamage {
private static final long serialVersionUID = 1L;
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
public String getApplyUserName() {
return applyUserName;
}
public void setApplyUserName(String applyUserName) {
this.applyUserName = applyUserName;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public Date getDoneTime() {
return doneTime;
}
public void setDoneTime(Date doneTime) {
this.doneTime = doneTime;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
public String getSuspendState() {
return suspendState;
}
public void setSuspendState(String suspendState) {
this.suspendState = suspendState;
}
public String getTodoUserId() {
return todoUserId;
}
public void setTodoUserId(String todoUserId) {
this.todoUserId = todoUserId;
}
public String getInstanceTypeName() {
return instanceTypeName;
}
public void setInstanceTypeName(String instanceTypeName) {
this.instanceTypeName = instanceTypeName;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
}

42
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java

@ -44,9 +44,6 @@ public class WarehouseInventoryReportDamage extends BaseEntity
private String applyDept;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 料号 */
@Excel(name = "料号")
@ -76,6 +73,10 @@ public class WarehouseInventoryReportDamage extends BaseEntity
@Excel(name = "仓库存放地址")
private String warehouseStoreAddress;
private String auditStatus;
private String useStatus;
/** 报废类型 */
private String scrapType;
@ -94,13 +95,20 @@ public class WarehouseInventoryReportDamage extends BaseEntity
/** 恢复流程实例ID */
private String restoreInstanceId;
/** 申请 */
/** 申请标题 */
private String applyTitle;
/** 申请人 */
@Excel(name = "申请人",sort = 10)
private String applyUser;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
//作废理由
private String cancelRemark;
private Long photoAttachId;
private String fileIdStr;
@ -332,6 +340,32 @@ public class WarehouseInventoryReportDamage extends BaseEntity
this.scrapType = scrapType;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getUseStatus() {
return useStatus;
}
public void setUseStatus(String useStatus) {
this.useStatus = useStatus;
}
@Override
public String getCancelRemark() {
return cancelRemark;
}
@Override
public void setCancelRemark(String cancelRemark) {
this.cancelRemark = cancelRemark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

14
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryReportDamageMapper.java

@ -1,6 +1,8 @@
package com.ruoyi.warehouse.mapper;
import java.util.List;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryReportDamageVo;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -20,7 +22,7 @@ public interface WarehouseInventoryReportDamageMapper
* @param reportDamageId 仓库库存报损ID
* @return 仓库库存报损
*/
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId);
public WarehouseInventoryReportDamageVo selectWarehouseInventoryReportDamageById(Long reportDamageId);
/**
* 查询仓库库存报损列表
@ -28,23 +30,23 @@ public interface WarehouseInventoryReportDamageMapper
* @param warehouseInventoryReportDamage 仓库库存报损
* @return 仓库库存报损集合
*/
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public List<WarehouseInventoryReportDamageVo> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
/**
* 新增仓库库存报损
*
* @param warehouseInventoryReportDamage 仓库库存报损
* @param warehouseInventoryReportDamageVo 仓库库存报损
* @return 结果
*/
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo);
/**
* 修改仓库库存报损
*
* @param warehouseInventoryReportDamage 仓库库存报损
* @param warehouseInventoryReportDamageVo 仓库库存报损
* @return 结果
*/
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamageVo);
/**
* 删除仓库库存报损

22
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryReportDamageService.java

@ -2,8 +2,12 @@ package com.ruoyi.warehouse.service;
import java.util.List;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryReportDamageVo;
import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
/**
* 仓库库存报损Service接口
@ -19,7 +23,7 @@ public interface IWarehouseInventoryReportDamageService
* @param reportDamageId 仓库库存报损ID
* @return 仓库库存报损
*/
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId);
public WarehouseInventoryReportDamageVo selectWarehouseInventoryReportDamageById(Long reportDamageId);
/**
* 查询仓库库存报损列表
@ -27,7 +31,7 @@ public interface IWarehouseInventoryReportDamageService
* @param warehouseInventoryReportDamage 仓库库存报损
* @return 仓库库存报损集合
*/
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public List<WarehouseInventoryReportDamageVo> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
/**
* 新增仓库库存报损
@ -35,7 +39,10 @@ public interface IWarehouseInventoryReportDamageService
* @param warehouseInventoryReportDamage 仓库库存报损
* @return 结果
*/
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamage);
@Transactional(rollbackFor = Exception.class)
int updateWarehouseInventoryInquiry(WarehouseInventoryReportDamageChild damageChild);
/**
* 修改仓库库存报损
@ -43,7 +50,14 @@ public interface IWarehouseInventoryReportDamageService
* @param warehouseInventoryReportDamage 仓库库存报损
* @return 结果
*/
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage);
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamage);
//修改审批后信息
@Transactional
int updateVerify(WarehouseInventoryReportDamageVo reportDamegeVo);
@Transactional(rollbackFor = Exception.class)
ProcessInstance submitApply(WarehouseInventoryReportDamageVo reportDamegeVo);
/**
* 批量删除仓库库存报损

231
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryReportDamageServiceImpl.java

@ -2,25 +2,35 @@ package com.ruoyi.warehouse.service.impl;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import com.github.pagehelper.Page;
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.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.warehouse.controller.WarehouseInventoryReportDamageController;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.impl.SysRoleServiceImpl;
import com.ruoyi.warehouse.domain.*;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryCheckVO;
import com.ruoyi.warehouse.domain.VO.WarehouseInventoryReportDamageVo;
import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO;
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper;
import com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageChildMapper;
import com.ruoyi.warehouse.service.IWarehouseInventoryReportDamageChildService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageMapper;
@ -54,6 +64,24 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
@Autowired
private WarehouseInventoryInquiryDetailMapper inventoryInquiryDetailMapper;
@Autowired
private SysRoleServiceImpl roleService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private IProcessService processService;
/**
* 查询仓库库存报损
*
@ -61,13 +89,17 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
* @return 仓库库存报损
*/
@Override
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId)
public WarehouseInventoryReportDamageVo selectWarehouseInventoryReportDamageById(Long reportDamageId)
{
WarehouseInventoryReportDamage warehouseInventoryReportDamage = warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageById(reportDamageId);
WarehouseInventoryReportDamageVo warehouseInventoryReportDamage = warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageById(reportDamageId);
List<WarehouseInventoryReportDamageChild> reportDamageChildList = damageChildMapper.selectWarehouseInventoryReportDamageChildByCode(warehouseInventoryReportDamage.getReportDamageCode());
if(StringUtils.isNotEmpty(reportDamageChildList)){
warehouseInventoryReportDamage.setWarehouseInventoryReportDamageChildList(reportDamageChildList);
}
SysUser applyUser = userMapper.selectUserByLoginName(warehouseInventoryReportDamage.getApplyUser());
if(applyUser != null){
warehouseInventoryReportDamage.setApplyUserName(applyUser.getUserName());
}
return warehouseInventoryReportDamage;
}
@ -78,9 +110,68 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
* @return 仓库库存报损
*/
@Override
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public List<WarehouseInventoryReportDamageVo> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
{
return warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage);
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<WarehouseInventoryReportDamageVo> list = (Page<WarehouseInventoryReportDamageVo>) warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage);
Page<WarehouseInventoryReportDamageVo> returnList = new Page<>();
for (WarehouseInventoryReportDamageVo reportDamageVo: list) {
SysUser sysUser = userMapper.selectUserByLoginName(reportDamageVo.getCreateBy());
if (sysUser != null) {
reportDamageVo.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(reportDamageVo.getApplyUser());
if (sysUser2 != null) {
reportDamageVo.setApplyUserName(sysUser2.getUserName());
}
String instanceId = reportDamageVo.getInstanceId();
// 当前环节
if (StringUtils.isNotBlank(instanceId)) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(instanceId)
// .singleResult();
.list(); // 例如请假会签,会同时拥有多个任务
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
String taskId = task.getId();
reportDamageVo.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
reportDamageVo.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
reportDamageVo.setTaskName("已挂起");
reportDamageVo.setSuspendState("2");
} else {
reportDamageVo.setTaskName(task.getName());
reportDamageVo.setSuspendState("1");
}
} else {
// 已办结或者已撤销
reportDamageVo.setTaskName("已结束");
}
} else {
reportDamageVo.setTaskName("未启动");
}
reportDamageVo.setTaskStatus(reportDamageVo.getTaskName());
if(reportDamageVo.getAuditStatus()==null){
reportDamageVo.setTaskStatus("未启动");
}else if(reportDamageVo.getAuditStatus().equals("1")){
reportDamageVo.setTaskStatus("审核通过");
}else if(reportDamageVo.getAuditStatus().equals("2")){
reportDamageVo.setTaskStatus("审核拒绝");
}
returnList.add(reportDamageVo);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}
/**
@ -91,7 +182,7 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamage)
{
//更改日期格式,以提高可读性
//移除日期中的分隔符以便于后续处理
@ -108,26 +199,27 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
//报损子表数据
//判断子表数据是否为空
if(StringUtils.isNotEmpty(warehouseInventoryReportDamage.getWarehouseInventoryReportDamageChildList())){
for(WarehouseInventoryReportDamageChild warehouseInventoryReportDamageChild:warehouseInventoryReportDamage.getWarehouseInventoryReportDamageChildList()) {
for(WarehouseInventoryReportDamageChild reportDamageChild:warehouseInventoryReportDamage.getWarehouseInventoryReportDamageChildList()) {
// 先验证库存查询记录是否为空,避免后续审核通过更新时为空影响流程
WarehouseInventoryInquiry inventoryInquiry = inventoryInquiryMapper.selectWarehouseInventoryInquiryByMaterialNo(reportDamageChild.getMaterialNo());
if(inventoryInquiry == null){
throw new BusinessException("物料"+reportDamageChild.getMaterialNo()+"库存查询记录为空!请检查");
}
//子表数据不为空,则插入子表数据
sumTotal = sumTotal.add(warehouseInventoryReportDamageChild.getActualScrapQuantity());
warehouseInventoryReportDamageChild.setMakeNo(warehouseInventoryReportDamage.getMakeNo());
warehouseInventoryReportDamageChild.setReportDamageCode(newCode);
sumTotal = sumTotal.add(reportDamageChild.getActualScrapQuantity());
reportDamageChild.setMakeNo(warehouseInventoryReportDamage.getMakeNo());
reportDamageChild.setReportDamageCode(newCode);
if(warehouseInventoryReportDamage.getApplyTime()!=null){
warehouseInventoryReportDamageChild.setScrapDate(warehouseInventoryReportDamage.getApplyTime());
}
warehouseInventoryReportDamageChild.setCreateTime(DateUtils.getNowDate());
warehouseInventoryReportDamageChild.setCreateBy(loginName);
warehouseInventoryReportDamageChild.setWarehouseCode(warehouseInventoryReportDamage.getWarehouseCode());
warehouseInventoryReportDamageChild.setWarehouseName(warehouseInventoryReportDamage.getWarehouseName());
warehouseInventoryReportDamageChild.setWarehouseStoreAddress(warehouseInventoryReportDamage.getWarehouseStoreAddress());
warehouseInventoryReportDamageChild.setApplyDeptId(String.valueOf(ShiroUtils.getSysUser().getDeptId()));
warehouseInventoryReportDamageChild.setApplyDept(ShiroUtils.getSysUser().getDept().getDeptName());
warehouseInventoryReportDamageChildService.insertWarehouseInventoryReportDamageChild(warehouseInventoryReportDamageChild);
int inquiryUpdateResult = updateWarehouseInventoryInquiry(warehouseInventoryReportDamageChild);
if(inquiryUpdateResult<=0){
throw new BusinessException("更新库存查询失败!");
reportDamageChild.setScrapDate(warehouseInventoryReportDamage.getApplyTime());
}
reportDamageChild.setCreateTime(DateUtils.getNowDate());
reportDamageChild.setCreateBy(loginName);
reportDamageChild.setWarehouseCode(warehouseInventoryReportDamage.getWarehouseCode());
reportDamageChild.setWarehouseName(warehouseInventoryReportDamage.getWarehouseName());
reportDamageChild.setWarehouseStoreAddress(warehouseInventoryReportDamage.getWarehouseStoreAddress());
reportDamageChild.setApplyDeptId(String.valueOf(ShiroUtils.getSysUser().getDeptId()));
reportDamageChild.setApplyDept(ShiroUtils.getSysUser().getDept().getDeptName());
warehouseInventoryReportDamageChildService.insertWarehouseInventoryReportDamageChild(reportDamageChild);
}
}else{
//子表数据为空,则抛出异常
@ -137,6 +229,8 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
return warehouseInventoryReportDamageMapper.insertWarehouseInventoryReportDamage(warehouseInventoryReportDamage);
}
@Transactional(rollbackFor = Exception.class)
@Override
public int updateWarehouseInventoryInquiry(WarehouseInventoryReportDamageChild damageChild){
WarehouseInventoryInquiry inventoryInquiry = inventoryInquiryMapper.selectWarehouseInventoryInquiryByMaterialNo(damageChild.getMaterialNo());
if(inventoryInquiry == null){
@ -184,7 +278,7 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
* @return 结果
*/
@Override
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage)
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamageVo warehouseInventoryReportDamage)
{
String loginName = ShiroUtils.getLoginName();
warehouseInventoryReportDamage.setUpdateBy(loginName);
@ -219,6 +313,85 @@ public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInve
return warehouseInventoryReportDamageMapper.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage);
}
//修改审批后信息
@Transactional
@Override
public int updateVerify(WarehouseInventoryReportDamageVo reportDamegeVo){
reportDamegeVo.setUpdateBy(ShiroUtils.getLoginName());
reportDamegeVo.setUpdateTime(DateUtils.getNowDate());
return warehouseInventoryReportDamageMapper.updateWarehouseInventoryReportDamage(reportDamegeVo);
}
/**
* 审批流程启动
* */
@Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(WarehouseInventoryReportDamageVo reportDamegeVo) {
SysUser user = ShiroUtils.getSysUser();
reportDamegeVo.setApplyUser(user.getLoginName());
reportDamegeVo.setApplyTime(DateUtils.getNowDate());
// 保存
insertWarehouseInventoryReportDamage(reportDamegeVo);
// 启动流程
String applyTitle = user.getUserName()+"发起了库存报损提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,reportDamegeVo, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
reportDamegeVo.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
reportDamegeVo.setAuditStatus("1");
reportDamegeVo.setUseStatus("1");
}
warehouseInventoryReportDamageMapper.updateWarehouseInventoryReportDamage(reportDamegeVo);
return processInstance;
}
/**
* 创建库存报损审核流程
* @param applyTitle
* @param instanceType
* @param user
* @return
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, WarehouseInventoryReportDamageVo reportDamegeVo, SysUser user) {
Long reportDamageId = reportDamegeVo.getReportDamageId();
String businessKey = reportDamageId.toString(); // 实体类 ID,作为流程的业务 key
String key = "reportDamage";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
reportDamegeVo.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, reportDamegeVo.getReportDamageCode(), key, variables);
String processInstanceId = processInstance.getId();
reportDamegeVo.setInstanceId(processInstanceId); // 建立双向关系
reportDamegeVo.setInstanceType(instanceType);
return processInstance;
}
/**
* 发起人节点判断
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("cgyyRole")){
variables.put("authority",1);
}else if(roleKeys.contains("ckzgRole")){
variables.put("authority",2);
}else if(roleKeys.contains("fzjlRole")||roleKeys.contains("admin")||roleKeys.contains("zjlRole")){
variables.put("authority",3);
}
}
/**
* 删除仓库库存报损对象
*

60
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml

@ -4,14 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageMapper">
<resultMap type="WarehouseInventoryReportDamage" id="WarehouseInventoryReportDamageResult">
<resultMap type="WarehouseInventoryReportDamageVo" id="WarehouseInventoryReportDamageResult">
<result property="reportDamageId" column="report_damage_id" />
<result property="reportDamageCode" column="report_damage_code" />
<result property="warehousScrapType" column="warehous_scrap_type" />
<result property="makeNo" column="make_no" />
<result property="whetherMakeNo" column="whether_make_no" />
<result property="applyDept" column="apply_dept" />
<result property="applyTime" column="apply_time" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="scrapType" column="scrap_type" />
@ -25,10 +24,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="auditStatus" column="audit_status" />
<result property="useStatus" column="use_status" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyTime" column="apply_time" />
<result property="applyUser" column="apply_user" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="cancelRemark" column="cancel_remark" />
</resultMap>
<sql id="selectWarehouseInventoryReportDamageVo">
select report_damage_id, report_damage_code, warehous_scrap_type, make_no, whether_make_no, apply_dept, apply_time, material_no, material_name, material_total, num_total, warehouse_code, warehouse_name, warehouse_store_address, remark, create_time, create_by, update_by, update_time from warehouse_inventory_report_damage
select report_damage_id, report_damage_code, warehous_scrap_type, make_no,
whether_make_no, apply_dept, material_no, material_name,
material_total, num_total, warehouse_code, warehouse_name,
warehouse_store_address, remark, create_time, create_by, update_by,
update_time,audit_status,use_status,instance_id,instance_type,
submit_instance_id,apply_title,apply_time,apply_user,cancel_instance_id,
restore_instance_id,cancel_remark from warehouse_inventory_report_damage
</sql>
<select id="selectWarehouseInventoryReportDamageList" parameterType="WarehouseInventoryReportDamage" resultMap="WarehouseInventoryReportDamageResult">
@ -50,8 +66,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="scrapType != null and scrapType != ''">
and report_damage_code in ( select report_damage_code from warehouse_inventory_report_damage_child where scrap_type like concat('%', #{scrapType}, '%') )
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="params.beginApplyTime != null and params.beginApplyTime != '' and params.endApplyTime != null and params.endApplyTime != ''"> and Date(apply_time) between #{params.beginApplyTime} and #{params.endApplyTime}</if>
</where>
order by audit_status asc, create_time desc
</select>
<select id="selectWarehouseInventoryReportDamageById" parameterType="Long" resultMap="WarehouseInventoryReportDamageResult">
@ -67,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="makeNo != null">make_no,</if>
<if test="whetherMakeNo != null">whether_make_no,</if>
<if test="applyDept != null">apply_dept,</if>
<if test="applyTime != null">apply_time,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="materialTotal != null">material_total,</if>
@ -80,6 +96,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="useStatus != null">use_status,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyTime != null">apply_time,</if>
<if test="applyUser != null">apply_user,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="cancelRemark != null">cancel_remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportDamageCode != null">#{reportDamageCode},</if>
@ -87,7 +114,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="makeNo != null">#{makeNo},</if>
<if test="whetherMakeNo != null">#{whetherMakeNo},</if>
<if test="applyDept != null">#{applyDept},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialTotal != null">#{materialTotal},</if>
@ -100,6 +126,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
<if test="cancelRemark != null">#{cancelRemark},</if>
</trim>
</insert>
@ -124,6 +161,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim>
where report_damage_id = #{reportDamageId}
</update>

32
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html

@ -250,20 +250,20 @@
showToggle:false,
width: 1000,
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false},
{title: '报损单号', field: 'reportDamageCode',visible: false},
{title: '料号', field: 'materialNo',},
{title: '图片', field: 'materialPhotourl',},
{title: '物料名称', field: 'materialName',},
{title: '物料类型', field: 'materialType',
{title: '库存报损id', field: 'reportDamageChildId', visible: false, align: 'center',},
{title: '报损单号', field: 'reportDamageCode',visible: false, align: 'center',},
{title: '料号', field: 'materialNo',align: 'center',},
{title: '图片', field: 'materialPhotourl',align: 'center',},
{title: '物料名称', field: 'materialName',align: 'center',},
{title: '物料类型', field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '描述', field: 'materialDescribe',},
{title: '品牌', field: 'materialBrand',},
{title: '单位', field: 'materialUnit',},
{title: '实际报废数量', field: 'actualScrapQuantity',
{title: '描述', field: 'materialDescribe',align: 'center',},
{title: '品牌', field: 'materialBrand',align: 'center',},
{title: '单位', field: 'materialUnit',align: 'center',},
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center',
editable:{
type: 'text',
validate: function(v) {
@ -272,32 +272,32 @@
}
}
},
{title: '报废类型', field: 'scrapType',
{title: '报废类型', field: 'scrapType',align: 'center',
editable:{
type: 'text',
}
},
{title: '报废明细', field: 'scrapDetail',
{title: '报废明细', field: 'scrapDetail',align: 'center',
editable:{
type: 'text',
}
},
{title: '品质判定', field: 'qualityAssessment',
{title: '品质判定', field: 'qualityAssessment',align: 'center',
editable:{
type: 'text',
}
},
{title: '预估价值(RMB)', field: 'estimatedValueRmb',
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center',
editable:{
type: 'text',
}
},
{title: '责任单位', field: 'responsibleUnit',
{title: '责任单位', field: 'responsibleUnit',align: 'center',
editable:{
type: 'text',
}
},
{title: '备注', field: 'remark',
{title: '备注', field: 'remark',align: 'center',
editable:{
type: 'text',
}

75
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/detail.html

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改仓库库存报损')" />
<th:block th:include="include :: header('仓库库存报损详情')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
@ -14,33 +14,16 @@
<input name="reportDamageCode" th:field="*{reportDamageCode}" class="form-control" type="text" disabled>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">报废类型:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="warehousScrapType" class="form-control m-b" th:with="type=${@dict.getType('warehous_scrap_type')}" disabled>-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousScrapType}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">关联生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
</div>
</div>
<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="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled>
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" disabled>
</div>
</div>
<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">
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" disabled>
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -52,6 +35,22 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否关联生产单号:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled>
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料数合计:</label>
<div class="col-sm-8">
@ -122,32 +121,32 @@
modalName: "仓库库存报损物料信息",
data: [[${warehouseInventoryReportDamage.warehouseInventoryReportDamageChildList}]],
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false},
{title: '报损单号', field: 'reportDamageCode',visible: false},
{title: '料号', field: 'materialNo',},
{title: '图片', field: 'materialPhotourl',},
{title: '物料名称', field: 'materialName',},
{title: '物料类型', field: 'materialType',
{title: '库存报损id', field: 'reportDamageChildId', visible: false, align: 'center',},
{title: '报损单号', field: 'reportDamageCode',visible: false, align: 'center',},
{title: '料号', field: 'materialNo',align: 'center',},
{title: '图片', field: 'materialPhotourl',align: 'center',},
{title: '物料名称', field: 'materialName',align: 'center',},
{title: '物料类型', field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '描述', field: 'materialDescribe',},
{title: '品牌', field: 'materialBrand',},
{title: '单位', field: 'materialUnit',},
{title: '实际报废数量', field: 'actualScrapQuantity',
{title: '描述', field: 'materialDescribe',align: 'center',},
{title: '品牌', field: 'materialBrand',align: 'center',},
{title: '单位', field: 'materialUnit',align: 'center',},
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center',
},
{title: '报废类型', field: 'scrapType',
{title: '报废类型', field: 'scrapType',align: 'center',
},
{title: '报废明细', field: 'scrapDetail',
{title: '报废明细', field: 'scrapDetail',align: 'center',
},
{title: '品质判定', field: 'qualityAssessment',
{title: '品质判定', field: 'qualityAssessment',align: 'center',
},
{title: '预估价值(RMB)', field: 'estimatedValueRmb',
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center',
},
{title: '责任单位', field: 'responsibleUnit',
{title: '责任单位', field: 'responsibleUnit',align: 'center',
},
{title: '备注', field: 'remark',
{title: '备注', field: 'remark',align: 'center',
},
{
title: '报损报告',

126
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/inventoryReportDamage.html

@ -49,10 +49,10 @@
<input type="text" name="materialName"/>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<label>申请时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginApplyTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endApplyTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -78,12 +78,16 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('warehouse:inventoryReportDamage:edit')}]];
var detailFlag = [[${@permission.hasPermi('warehouse:inventoryReportDamage:detail')}]];
var cancelFlag = [[${@permission.hasPermi('warehouse:inventoryReportDamage:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('warehouse:inventoryReportDamage:restore')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
@ -104,34 +108,112 @@
columns: [
{checkbox: true},
{title: '库存报损id', field: 'reportDamageId', visible: false},
{title: '报损单号', field: 'reportDamageCode',},
{title: '申请部门', field: 'applyDept',},
{title: '申请时间', field: 'applyTime',},
{title: '报废类型', field: 'warehousScrapType',visible: false,
{title: '当前状态',field: 'taskStatus',
align: 'center',
formatter: function(value, row, index) {
if(value == "未启动"|| value == "审核拒绝"){
return '<span class="badge badge-danger">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title: '流程实例ID',field: 'instanceId',visible: false,align: 'center',},
{title: '流程提交实例ID',field: 'submitInstanceId',visible: false,align: 'center',},
{title: '流程作废实例ID',field: 'cancelInstanceId',visible: false,align: 'center',},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false,align: 'center',},
{title: '流程实例类型', field: 'instanceTypeName',visible: false,align: 'center',},
{title: '申请人',field: 'applyUserName', align: 'center',
// formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';}
},
{title: '申请时间', field: 'applyTime',align: 'center',},
{title: '申请部门', field: 'applyDept',align: 'center',},
{title: '当前任务ID',field: 'taskId',visible: false,align: 'center',},
{title: '待办用户ID',field: 'todoUserId', visible: false,align: 'center',},
{title: '当前任务名称',field: 'taskName',
align: 'center',visible: false,
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
title: '使用状态',
field: 'useStatus',
align: 'center',
visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
title: '审核状态',
field: 'auditStatus',
align: 'center',
visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusData, value);
}
},
{title: '报损单号', field: 'reportDamageCode',align: 'center',},
{title: '报废类型', field: 'warehousScrapType',visible: false,align: 'center',
formatter: function(value, row, index) {return $.table.selectDictLabel(warehousScrapTypeDatas, value);}
},
{title: '是否关联生产单号', field: 'whetherMakeNo',
{title: '是否关联生产单号', field: 'whetherMakeNo',align: 'center',
formatter: function(value, row, index) {return $.table.selectDictLabel(whetherMakeNoDatas, value);}
},
{title: '生产单号', field: 'makeNo',},
{title: '物料数合计', field: 'materialTotal',},
{title: '数量合计', field: 'numTotal',},
{title: '仓库ID', field: 'warehouseCode',},
{title: '仓库名称', field: 'warehouseName',},
{title: '仓库存放地址', field: 'warehouseStoreAddress',},
{title: '备注', field: 'remark',},
{title: '录入人', field: 'createBy',},
{title: '录入时间', field: 'createTime',},
{title: '更新人', field: 'updateBy',},
{title: '生产单号', field: 'makeNo',align: 'center',},
{title: '物料数合计', field: 'materialTotal',align: 'center',},
{title: '数量合计', field: 'numTotal',align: 'center',},
{title: '仓库ID', field: 'warehouseCode',align: 'center',},
{title: '仓库名称', field: 'warehouseName',align: 'center',},
{title: '仓库存放地址', field: 'warehouseStoreAddress',align: 'center',},
{title: '备注', field: 'remark',align: 'center',},
{title: '录入人', field: 'createBy',align: 'center',},
{title: '录入时间', field: 'createTime',align: 'center',visible: false,},
{title: '更新人', field: 'updateBy',align: 'center',},
{title: '更新时间', field: 'updateTime',align: 'center',},
{title: '操作', align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.reportDamageId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.reportDamageId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.reportDamageId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// if(row.auditStatus == "1"&& row.useStatus == "1"){
// // 作废
// actions.push('<a class="' + cancelFlag + '" href="javascript:void(0)" onclick="cancel(\'' + row.reportDamageId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// }
// // 已作废
// if(row.useStatus=="2" && !row.restoreInstanceId){
// // 恢复
// actions.push('<a class="btn ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.reportDamageId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
// }
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
actions.push('<a class="btn btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
actions.push('<a class="btn btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
actions.push('<a class="btn btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.reportDamageId + '\')"><i class="fa fa-edit"></i>详情</a> ');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
// return actions.join('');
}
}
]
],
rowStyle: function (row, index) {
if (row.auditStatus=="0") {
// 如果审核状态为待审核,则设置为红色
return {css:{"color":"red"}};
}
// 否则使用默认样式
return {};
}
};
$.table.init(options);
});

221
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskCkzgVerify.html

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('仓库主管审核')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inventoryReportDamage-ckzg" th:object="${formData}">
<input name="inventoryCheckId" th:field="*{reportDamageId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请部门:</label>
<div class="col-sm-8">
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">报损单号:</label>
<div class="col-sm-8">
<input name="reportDamageCode" th:field="*{reportDamageCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否关联生产单号:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled>
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料数合计:</label>
<div class="col-sm-8">
<input name="materialTotal" th:field="*{materialTotal}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量合计:</label>
<div class="col-sm-8">
<input name="numTotal" th:field="*{numTotal}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库ID:</label>
<div class="col-sm-8">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库名称:</label>
<div class="col-sm-8">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库存放地址:</label>
<div class="col-sm-8">
<input name="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" disabled>[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group" id="cancelRemark" hidden>
<label class="col-sm-3 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="ckzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_ckzgVerifyApproved" id="ckzgVerifyApproved" class="form-control m-b" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<!-- 物料信息 -->
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报损物料信息</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]];
var prefix = ctx + "warehouse/inventoryReportDamage";
$(function () {
var options = {
id : 'bootstrap-table-reportDamage-child',
modalName: "仓库库存报损物料信息",
data: [[${formData.warehouseInventoryReportDamageChildList}]],
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false,align: 'center',},
{title: '报损单号', field: 'reportDamageCode',visible: false,align: 'center',},
{title: '料号', field: 'materialNo',align: 'center',},
{title: '图片', field: 'materialPhotourl',align: 'center',},
{title: '物料名称', field: 'materialName',align: 'center',},
{title: '物料类型', field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '描述', field: 'materialDescribe',align: 'center',},
{title: '品牌', field: 'materialBrand',align: 'center',},
{title: '单位', field: 'materialUnit',align: 'center',},
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center',
},
{title: '报废类型', field: 'scrapType',align: 'center',
},
{title: '报废明细', field: 'scrapDetail',align: 'center',
},
{title: '品质判定', field: 'qualityAssessment',align: 'center',
},
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center',
},
{title: '责任单位', field: 'responsibleUnit',align: 'center',
},
{title: '备注', field: 'remark',align: 'center',
},
{
title: '报损报告',
field: 'damageReportUrl',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
]
};
$.table.init(options);
});
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-inventoryReportDamage-ckzg').serialize());
}
}
</script>
</body>
</html>

221
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskFzjlVerify.html

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('副总经理审核')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inventoryReportDamage-fzjl" th:object="${formData}">
<input name="inventoryCheckId" th:field="*{reportDamageId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请部门:</label>
<div class="col-sm-8">
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">报损单号:</label>
<div class="col-sm-8">
<input name="reportDamageCode" th:field="*{reportDamageCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否关联生产单号:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled>
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料数合计:</label>
<div class="col-sm-8">
<input name="materialTotal" th:field="*{materialTotal}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量合计:</label>
<div class="col-sm-8">
<input name="numTotal" th:field="*{numTotal}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库ID:</label>
<div class="col-sm-8">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库名称:</label>
<div class="col-sm-8">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库存放地址:</label>
<div class="col-sm-8">
<input name="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" disabled>[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group" id="cancelRemark" hidden>
<label class="col-sm-3 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="fzjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_fzjlVerifyApproved" id="fzjlVerifyApproved" class="form-control m-b" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<!-- 物料信息 -->
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报损物料信息</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]];
var prefix = ctx + "warehouse/inventoryReportDamage";
$(function () {
var options = {
id : 'bootstrap-table-reportDamage-child',
modalName: "仓库库存报损物料信息",
data: [[${formData.warehouseInventoryReportDamageChildList}]],
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false},
{title: '报损单号', field: 'reportDamageCode',visible: false},
{title: '料号', field: 'materialNo',align: 'center',},
{title: '图片', field: 'materialPhotourl',align: 'center',},
{title: '物料名称', field: 'materialName',align: 'center',},
{title: '物料类型', field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '描述', field: 'materialDescribe',align: 'center',},
{title: '品牌', field: 'materialBrand',align: 'center',},
{title: '单位', field: 'materialUnit',align: 'center',},
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center',
},
{title: '报废类型', field: 'scrapType',align: 'center',
},
{title: '报废明细', field: 'scrapDetail',align: 'center',
},
{title: '品质判定', field: 'qualityAssessment',align: 'center',
},
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center',
},
{title: '责任单位', field: 'responsibleUnit',align: 'center',
},
{title: '备注', field: 'remark',align: 'center',
},
{
title: '报损报告',
field: 'damageReportUrl',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
]
};
$.table.init(options);
});
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-inventoryReportDamage-fzjl').serialize());
}
}
</script>
</body>
</html>

426
ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/taskModifyApply.html

@ -0,0 +1,426 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改仓库库存报损')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-fileinput-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inventoryReportDamage-edit" th:object="${formData}">
<input name="reportDamageId" th:field="*{reportDamageId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<!--驳回调整允许更新内容-->
<input type="hidden" name="saveEntity" value="true" />
<div class="form-group">
<label class="col-sm-4 control-label is-required">报损单号:</label>
<div class="col-sm-8">
<input name="reportDamageCode" th:field="*{reportDamageCode}" class="form-control" type="text" required readonly/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">申请部门:</label>
<div class="col-sm-8">
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" required readonly></input>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">申请时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">是否关联生产单号:</label>
<div class="col-sm-8">
<div class="radio-inline">
<label><input type="radio" name="whetherMakeNo" value="0" checked></label>
</div>
<div class="radio-inline">
<label><input type="radio" name="whetherMakeNo" value="1"></label>
</div>
</div>
</div>
<div class="form-group" id="makeNoInput">
<label class="col-sm-4 control-label is-required">关联生产单号:</label>
<div class="col-sm-8">
<input id="selectMakeNo" name="makeNo" th:field="*{makeNo}" class="form-control select2-multiple" type="text" required>
</input>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">仓库ID:</label>
<div class="col-sm-8">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">仓库名称:</label>
<div class="col-sm-8">
<select id="stockNameSelct" name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" required></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">仓库存放地址:</label>
<div class="col-sm-8">
<input name="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required" for="reApply">是否继续申请:</label>
<div class="col-sm-8">
<select required id="reApply" name="p_B_reApply" class="form-control m-b">
<option value="true">重新申请</option>
<option value="false">结束流程</option>
</select>
</div>
</div>
<div class="form-group ">
<label class="col-sm-4 control-label ">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group" hidden>
<div class="col-sm-8">
<input id="inventoryReportDamageChildList" name="inventoryReportDamageChildList" class="form-control">
</div>
</div>
<!-- 物料信息 -->
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择物料</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 选择物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "warehouse/inventoryReportDamage";
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]];
$("#form-inventoryReportDamage-edit").validate({focusCleanup: true});
var warehouseInventoryReportDamage = [[${formData}]];
var taskId = [[${taskId}]];
var stockData = [];
var makeNo = [[${formData.makeNo}]]
function submitHandler() {
if ($.validate.form()) {
var rows = $('#bootstrap-table-reportDamage-child').bootstrapTable('getData');
// 检查表格数据是否为空
if (rows.length === 0) {
$.modal.alertWarning("请至少添加一条物料信息再保存!");
return;
}else{
$("#inventoryReportDamageChildList").val(JSON.stringify(rows));
}
$.operate.save(prefix + "/complete/"+taskId, $("#form-inventoryReportDamage-edit").serialize());
}
}
$(function (){
// 单选按钮赋值
var whetherMakeNo = [[${formData.whetherMakeNo}]];
if(whetherMakeNo === "1"){
$('input:radio[name="whetherMakeNo"][value="1"]').prop('checked', true);
}else{
$('input:radio[name="whetherMakeNo"][value="0"]').prop('checked', true);
}
var options = {
id : 'bootstrap-table-reportDamage-child',
modalName: "仓库库存报损物料信息",
showColumns: false,
showSearch: false,
showRefresh:false,
showToggle:false,
data: [[${formData.warehouseInventoryReportDamageChildList}]],
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false,align: 'center',},
{title: '报损单号', field: 'reportDamageCode',visible: false,align: 'center',},
{title: '料号', field: 'materialNo',align: 'center',},
{title: '图片', field: 'materialPhotourl',align: 'center',},
{title: '物料名称', field: 'materialName',align: 'center',},
{title: '物料类型', field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '描述', field: 'materialDescribe',align: 'center',},
{title: '品牌', field: 'materialBrand',align: 'center',},
{title: '单位', field: 'materialUnit',align: 'center',},
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center',
editable: {
type: 'text',
mode: 'inline', // 设定为行内编辑模式
events: {
blur: function(e) {
var value = $(this).val();
var errorMessage = validateActualScrapQuantity(value);
if (errorMessage) {alert(errorMessage);}
}
},
},
},
{title: '报废类型', field: 'scrapType',align: 'center',
editable:{
type: 'text',
}
},
{title: '报废明细', field: 'scrapDetail',align: 'center',
editable:{
type: 'text',
}
},
{title: '品质判定', field: 'qualityAssessment',align: 'center',
editable:{
type: 'text',
}
},
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center',
editable:{
type: 'text',
}
},
{title: '责任单位', field: 'responsibleUnit',align: 'center',
editable:{
type: 'text',
}
},
{title: '备注', field: 'remark',align: 'center',
editable:{
type: 'text',
}
},
{
title: '报损报告',
field: 'damageReportUrl',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>上传</a> ');
return actions.join('');
}
},
{title: '操作', align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialNo + '\')"><i class="fa fa-edit"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
var stockName = warehouseInventoryReportDamage.warehouseName;
loadWarehouseCodes(stockName);
// loadMakeNo();
$("#selectMakeNo").val(makeNo);
changeWhetherMakeNo();
//单选改变是否关联生产单号显示关联生产单号输入框
$("input[name='whetherMakeNo']").change(function () {
changeWhetherMakeNo();
});
$('#stockNameSelct').on('change', function() {
var selectedValue = $(this).val();
// console.log(selectedValue);
$.each(stockData,function (i,stock){
if(stock.stockName === selectedValue){
$("input[name='warehouseCode']").val(stock.stockNo);
$("input[name='warehouseStoreAddress']").val(stock.stockAddress);
}
});
});
})
//根据是否关联生产单号显示关联生产单号输入框
function changeWhetherMakeNo() {
var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val();
// console.log(whetherMakeNo);
if (whetherMakeNo === "1") {
$("#makeNoInput").show();
} else {
$("#makeNoInput").hide();
}
}
function loadWarehouseCodes(defaultStockName) {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
success: function(data) {
var select = $('#stockNameSelct');
$.each(data, function(i, option) {
var stockValue = {};
stockValue.stockName = option.stockName;
stockValue.stockNo = option.stockNO;
stockValue.stockAddress = option.stockAddr;
stockData.push(stockValue);
var optionElement = $('<option>', {
value: option.stockName,
text : option.stockName
});
select.append(optionElement);
if (option.stockName === defaultStockName) {
optionElement.prop('selected', true);
}
});
},
error: function(error) {
console.log('Error: ', error);
}
});
}
function loadMakeNo() {
var options = [];
options.push({id: '',text: '',value: ''})
$.ajax({
url: ctx + 'system/makeorder/getAllMakeNos',
type: "GET",
dataType: "json",
success: function (result) {
if (result != null) {
result.forEach(function (re){
var option = {};
option.id = re.makeNo;
option.text = re.makeNo;
option.value = re.makeNo;
options.push(option);
});
$("#selectMakeNo").select2({
data: options,
}).on('select2:loaded', function(e) {
// 打印所有选项
var allOptions = $("#selectMakeNo").select2('data');
console.log("All Options from Select2:", allOptions);
allOptions.forEach(function(option) {
console.log("ID: " + option.id + ", Text: " + option.text);
});
});
} else {
$.modal.msgError("生产订单编号获取失败!");
}
}
});
}
function validateActualScrapQuantity(v) {
if ($.common.isEmpty(v)) {
return '实际报废数量不能为空';
}
var num = parseInt(v);
if (num <= 0) {
return '实际报废数量必须大于0';
}
}
function insertRow() {
var ifMakeNo = $("input[name='whetherMakeNo']:checked").val();
if(ifMakeNo === "1"){
var makeNo = $("input[name='makeNo']").val();
if(!makeNo){
$.modal.alertWarning("请输入生产单号!")
}else{
var url = prefix + '/materialInMakeOrderSelect/' + makeNo;
var options = {
title: '选择物料',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
}else{
var url = ctx + 'warehouse/inventoryCheck/materialSelect';
var options = {
title: '选择物料',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
}
function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var data = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData');
var rows = data.length;
if(rows > 0){
for(var i=0;i<rows;i++){
for(var j=0;j<rowData.length;j++){
if(data[i].materialNo===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
rowData.split(j,1);
break;
}
}
};
}
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
}
layer.close(index);
}
function insertTable(rowData){
var newRow = {
materialNo:rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialBrand: rowData.brand,
materialPhotourl: rowData.materialPhotourl,
materialDescribe: rowData.describe,
materialUnit: rowData.unit,
actualScrapQuantity: "",
scrapType: "",
scrapDetail: "",
qualityAssessment: "",
estimatedValueRmb: "",
responsibleUnit: "",
remark : ""
}
$("#bootstrap-table-reportDamage-child").bootstrapTable('append',newRow);
}
// 逻辑删除前端的一行数据
function removeRow(materialNo){
$("#bootstrap-table-reportDamage-child").bootstrapTable('remove', {field: 'materialNo', values: materialNo})
}
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>
Loading…
Cancel
Save