入库逻辑修改
This commit is contained in:
@@ -28,6 +28,7 @@ import com.ruoyi.out.outStockout.service.IOutStockoutService;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import com.ruoyi.pda.mapper.PdaMapper;
|
||||
import com.ruoyi.pda.service.PdaService;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -56,6 +57,8 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
private PdaService pdaService;
|
||||
@Autowired
|
||||
private PdaMapper pdaMapper;
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
|
||||
@Autowired
|
||||
private IBasCargoSpaceWeightRuleService basCargoSpaceWeightRuleService;
|
||||
@@ -67,7 +70,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
|
||||
|
||||
@Override
|
||||
@Scheduled(fixedDelay = 3000)
|
||||
//@Scheduled(fixedDelay = 3000)
|
||||
public void pushOutMydoJob() {
|
||||
//查询所有未推送的料箱出库作业
|
||||
List<String> list = new ArrayList<>();
|
||||
@@ -76,6 +79,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
list.add("22");
|
||||
list.add("23");
|
||||
list.add("24");
|
||||
list.add("25");
|
||||
list.add("26");
|
||||
for (int i = 1; i <= 6; i++) {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
@@ -318,7 +322,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
MydoJob outJob = outMydoJobs.get(0);
|
||||
outJob.setExecutionPhase("2");
|
||||
mydoJobService.updateMydoJob(outJob);
|
||||
if ("24".equals(outJob.getInOrOut())) {
|
||||
if ("24".equals(outJob.getInOrOut()) || "25".equals(outJob.getInOut())) {
|
||||
String[] jobIds = new String[]{outJob.getJobId()};
|
||||
mydoJobService.OuthandFinish(jobIds);
|
||||
}
|
||||
@@ -359,16 +363,20 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
|
||||
@Override
|
||||
public AjaxResult reMaterial(ReMaterialParam reMaterialParam) {
|
||||
//重新分配物料
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(reMaterialParam.getJobId());
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
String stockOutId = mydoJobDetails.get(0).getInOrOutId();
|
||||
// 作废作业
|
||||
mydoJobService.OuthandInvalidation(new String[]{mydoJob.getJobId()});
|
||||
//调用自动分配
|
||||
return outStockoutService.autoAllot(stockOutId);
|
||||
mydoJob.setStatus("4");
|
||||
mydoJob.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
//标记异常货位
|
||||
String cargoSpaceId = mydoJob.getCargoSpaceId();
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(cargoSpaceId);
|
||||
basCargoSpace.setStatus("6");
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
//删除库存
|
||||
//basStockService.deleteKtpStockByTrayCodeAndWarehouseId(mydoJob.getTrayCode(),mydoJob.getWarehouseId());
|
||||
//删除作业
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.in.bind.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import com.ruoyi.in.bind.service.IInStockTraycodeBindMsgService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 入库单据入库绑定Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/trayCodeBind/trayCodeBind")
|
||||
public class InStockTraycodeBindMsgController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IInStockTraycodeBindMsgService inStockTraycodeBindMsgService;
|
||||
|
||||
/**
|
||||
* 查询入库单据入库绑定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
startPage();
|
||||
List<InStockTraycodeBindMsg> list = inStockTraycodeBindMsgService.selectInStockTraycodeBindMsgList(inStockTraycodeBindMsg);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库单据入库绑定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:export')")
|
||||
@Log(title = "入库单据入库绑定", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
List<InStockTraycodeBindMsg> list = inStockTraycodeBindMsgService.selectInStockTraycodeBindMsgList(inStockTraycodeBindMsg);
|
||||
ExcelUtil<InStockTraycodeBindMsg> util = new ExcelUtil<InStockTraycodeBindMsg>(InStockTraycodeBindMsg.class);
|
||||
util.exportExcel(response, list, "入库单据入库绑定数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库单据入库绑定详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(inStockTraycodeBindMsgService.selectInStockTraycodeBindMsgById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库单据入库绑定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:add')")
|
||||
@Log(title = "入库单据入库绑定", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
return toAjax(inStockTraycodeBindMsgService.insertInStockTraycodeBindMsg(inStockTraycodeBindMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库单据入库绑定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:edit')")
|
||||
@Log(title = "入库单据入库绑定", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
return toAjax(inStockTraycodeBindMsgService.updateInStockTraycodeBindMsg(inStockTraycodeBindMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入库单据入库绑定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('trayCodeBind:trayCodeBind:remove')")
|
||||
@Log(title = "入库单据入库绑定", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(inStockTraycodeBindMsgService.deleteInStockTraycodeBindMsgByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.ruoyi.in.bind.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 入库单据入库绑定对象 in_stock_traycode_bind_msg
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public class InStockTraycodeBindMsg extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 主单id */
|
||||
@Excel(name = "主单id")
|
||||
private String inStockId;
|
||||
|
||||
/** 子单id */
|
||||
@Excel(name = "子单id")
|
||||
private String inStockDetailId;
|
||||
|
||||
/** 托盘码 */
|
||||
@Excel(name = "托盘码")
|
||||
private String trayCode;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 位置 */
|
||||
@Excel(name = "位置")
|
||||
private String location;
|
||||
|
||||
/** 备用1 */
|
||||
@Excel(name = "备用1")
|
||||
private String spare1;
|
||||
|
||||
/** 备用2 */
|
||||
@Excel(name = "备用2")
|
||||
private String spare2;
|
||||
|
||||
/** 备用3 */
|
||||
@Excel(name = "备用3")
|
||||
private String spare3;
|
||||
|
||||
/** 备用4 */
|
||||
@Excel(name = "备用4")
|
||||
private String spare4;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setInStockId(String inStockId)
|
||||
{
|
||||
this.inStockId = inStockId;
|
||||
}
|
||||
|
||||
public String getInStockId()
|
||||
{
|
||||
return inStockId;
|
||||
}
|
||||
|
||||
public void setInStockDetailId(String inStockDetailId)
|
||||
{
|
||||
this.inStockDetailId = inStockDetailId;
|
||||
}
|
||||
|
||||
public String getInStockDetailId()
|
||||
{
|
||||
return inStockDetailId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setLocation(String location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
public void setSpare4(String spare4)
|
||||
{
|
||||
this.spare4 = spare4;
|
||||
}
|
||||
|
||||
public String getSpare4()
|
||||
{
|
||||
return spare4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("inStockId", getInStockId())
|
||||
.append("inStockDetailId", getInStockDetailId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("quantity", getQuantity())
|
||||
.append("location", getLocation())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("spare4", getSpare4())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.ruoyi.in.bind.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import com.ruoyi.in.stockin.domain.TrayCodeModel;
|
||||
|
||||
/**
|
||||
* 入库单据入库绑定Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public interface InStockTraycodeBindMsgMapper
|
||||
{
|
||||
/**
|
||||
* 查询入库单据入库绑定
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 入库单据入库绑定
|
||||
*/
|
||||
public InStockTraycodeBindMsg selectInStockTraycodeBindMsgById(Long id);
|
||||
|
||||
/**
|
||||
* 查询入库单据入库绑定列表
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 入库单据入库绑定集合
|
||||
*/
|
||||
public List<InStockTraycodeBindMsg> selectInStockTraycodeBindMsgList(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 新增入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 修改入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 删除入库单据入库绑定
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInStockTraycodeBindMsgById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除入库单据入库绑定
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInStockTraycodeBindMsgByIds(Long[] ids);
|
||||
|
||||
void deleteInStockTraycodeBindMsgByInStockDetailId(String stockinDetailId);
|
||||
|
||||
List<TrayCodeModel> selectModelByTrayCode(String stockinGuid);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.in.bind.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
|
||||
/**
|
||||
* 入库单据入库绑定Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public interface IInStockTraycodeBindMsgService
|
||||
{
|
||||
/**
|
||||
* 查询入库单据入库绑定
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 入库单据入库绑定
|
||||
*/
|
||||
public InStockTraycodeBindMsg selectInStockTraycodeBindMsgById(Long id);
|
||||
|
||||
/**
|
||||
* 查询入库单据入库绑定列表
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 入库单据入库绑定集合
|
||||
*/
|
||||
public List<InStockTraycodeBindMsg> selectInStockTraycodeBindMsgList(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 新增入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 修改入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg);
|
||||
|
||||
/**
|
||||
* 批量删除入库单据入库绑定
|
||||
*
|
||||
* @param ids 需要删除的入库单据入库绑定主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInStockTraycodeBindMsgByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除入库单据入库绑定信息
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInStockTraycodeBindMsgById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.in.bind.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.in.bind.mapper.InStockTraycodeBindMsgMapper;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import com.ruoyi.in.bind.service.IInStockTraycodeBindMsgService;
|
||||
|
||||
/**
|
||||
* 入库单据入库绑定Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
@Service
|
||||
public class InStockTraycodeBindMsgServiceImpl implements IInStockTraycodeBindMsgService
|
||||
{
|
||||
@Autowired
|
||||
private InStockTraycodeBindMsgMapper inStockTraycodeBindMsgMapper;
|
||||
|
||||
/**
|
||||
* 查询入库单据入库绑定
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 入库单据入库绑定
|
||||
*/
|
||||
@Override
|
||||
public InStockTraycodeBindMsg selectInStockTraycodeBindMsgById(Long id)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.selectInStockTraycodeBindMsgById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入库单据入库绑定列表
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 入库单据入库绑定
|
||||
*/
|
||||
@Override
|
||||
public List<InStockTraycodeBindMsg> selectInStockTraycodeBindMsgList(InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.selectInStockTraycodeBindMsgList(inStockTraycodeBindMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.insertInStockTraycodeBindMsg(inStockTraycodeBindMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库单据入库绑定
|
||||
*
|
||||
* @param inStockTraycodeBindMsg 入库单据入库绑定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateInStockTraycodeBindMsg(InStockTraycodeBindMsg inStockTraycodeBindMsg)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.updateInStockTraycodeBindMsg(inStockTraycodeBindMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除入库单据入库绑定
|
||||
*
|
||||
* @param ids 需要删除的入库单据入库绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInStockTraycodeBindMsgByIds(Long[] ids)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.deleteInStockTraycodeBindMsgByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入库单据入库绑定信息
|
||||
*
|
||||
* @param id 入库单据入库绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInStockTraycodeBindMsgById(Long id)
|
||||
{
|
||||
return inStockTraycodeBindMsgMapper.deleteInStockTraycodeBindMsgById(id);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.domain.vo.InstockInVo;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockinfinish.service.IInStockinFinishService;
|
||||
import com.ruoyi.search.ViewOutJobFlow.domain.ViewOutJobFlow;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -107,4 +108,12 @@ public class InStockinController extends BaseController
|
||||
{
|
||||
return toAjax(inStockinService.deleteInStockinByStockinGuids(stockinGuids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('in:stockIn:productBack')")
|
||||
@Log(title = "生成退货入库单据", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/productBack")
|
||||
public AjaxResult productBack(@RequestBody List<ViewOutJobFlow> list)
|
||||
{
|
||||
return inStockinService.productBack(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.in.stockin.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TrayCodeModel {
|
||||
|
||||
private String trayCode;
|
||||
private String model;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.in.stockin.service;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.domain.vo.InstockInVo;
|
||||
import com.ruoyi.search.ViewOutJobFlow.domain.ViewOutJobFlow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -72,4 +73,6 @@ public interface IInStockinService
|
||||
public int deleteInStockinByStockinGuid(String stockinGuid);
|
||||
|
||||
public List<InStockin> selectStockinByDetail(String stockinDetailId);
|
||||
|
||||
AjaxResult productBack(List<ViewOutJobFlow> list);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import com.ruoyi.in.bind.mapper.InStockTraycodeBindMsgMapper;
|
||||
import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.domain.vo.InstockInVo;
|
||||
import com.ruoyi.in.stockin.mapper.InStockinMapper;
|
||||
@@ -18,12 +20,17 @@ import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.mes.callback.domain.MesBillCallback;
|
||||
import com.ruoyi.mes.callback.service.IMesBillCallbackService;
|
||||
import com.ruoyi.search.ViewOutJobFlow.domain.ViewOutJobFlow;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 入库单据Service业务层处理
|
||||
@@ -43,6 +50,12 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
private IBasJobIdService iBasJobIdService;
|
||||
@Autowired
|
||||
private IMesBillCallbackService mesBillCallbackService;
|
||||
@Autowired
|
||||
private IBasJobIdService basJobIdService;
|
||||
@Autowired
|
||||
private InStockTraycodeBindMsgMapper inStockTraycodeBindMsgMapper;
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
|
||||
/**
|
||||
* 查询入库单据
|
||||
@@ -66,9 +79,26 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
//@DataScope(warehouseAlias = "is2")
|
||||
public List<InStockin> selectInStockinList(InStockin inStockin)
|
||||
{
|
||||
/*if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
inStockin.setDepartmentNo(cn.hutool.core.convert.Convert.toStr(SecurityUtils.getDeptId()));
|
||||
}*/
|
||||
if (!"admin".equals(SecurityUtils.getUsername())) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
List<SysRole> roles = loginUser.getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//入库需要查看本部门任务
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey()) || "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()) {
|
||||
//二联合普通人员
|
||||
inStockin.setWarehouseId("02");
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey()) || "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()) {
|
||||
//三联合普通人员
|
||||
inStockin.setWarehouseId("01");
|
||||
}
|
||||
|
||||
}
|
||||
return inStockinMapper.selectInStockinList(inStockin);
|
||||
}
|
||||
|
||||
@@ -129,7 +159,7 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
inStockin.setWarehouseId(inStockinVo.getWarehouseId());
|
||||
inStockin.setStatus("1");
|
||||
inStockin.setStockSource(inStockinVo.getStockSource());
|
||||
inStockin.setSpare1(inStockinVo.getProductType());
|
||||
//inStockin.setSpare1(inStockinVo.getProductType());
|
||||
inStockin.setSpare5(inStockinVo.getRemark());
|
||||
inStockinMapper.insertInStockin(inStockin);
|
||||
for (int i = 1; i <= productVoList.size(); i++) {
|
||||
@@ -177,19 +207,102 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
if (!"3".equals(old.getStatus())){
|
||||
throw new RuntimeException("单据状态非正执行状态!");
|
||||
}
|
||||
//对比扫码数量 与实际入库数量是否一致
|
||||
//查询单据信息 修改结束日期
|
||||
InStockinDetail inStockinDetailParam = new InStockinDetail();
|
||||
inStockinDetailParam.setStockinGuid(inStockin.getStockinGuid());
|
||||
List<InStockinDetail> list = iInStockinDetailService.selectInStockinDetailList(inStockinDetailParam);
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
boolean b = list.stream().allMatch(x -> x.getAssignNum().equals(x.getScanNum()));
|
||||
if (!b){
|
||||
throw new RuntimeException("扫码数量与实际入库数量不一致!");
|
||||
}
|
||||
}
|
||||
inStockin.setFinishDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||
inStockinMapper.updateInStockin(inStockin);
|
||||
|
||||
//查询子单信息 生成库存列表
|
||||
List<InStockinDetail> list = iInStockinDetailService.selectInStockinDetailList(inStockinDetailParam);
|
||||
InStockTraycodeBindMsg param = new InStockTraycodeBindMsg();
|
||||
param.setInStockId(inStockin.getStockinGuid());
|
||||
//查询子单绑定信息
|
||||
List<InStockTraycodeBindMsg> inStockTraycodeBindMsgs = inStockTraycodeBindMsgMapper.selectInStockTraycodeBindMsgList(param);
|
||||
Map<String, List<InStockTraycodeBindMsg>> detailTrayCodeBindMap = inStockTraycodeBindMsgs.stream().collect(Collectors.groupingBy(InStockTraycodeBindMsg::getInStockDetailId));
|
||||
List<BasStock> basStockList = new ArrayList<>();
|
||||
for (InStockinDetail inStockinDetail : list) {
|
||||
List<InStockTraycodeBindMsg> inStockTraycodeBindMsgList = detailTrayCodeBindMap.get(inStockinDetail.getStockinDetailId());
|
||||
for (InStockTraycodeBindMsg inStockTraycodeBindMsg : inStockTraycodeBindMsgList) {
|
||||
String location = inStockTraycodeBindMsg.getLocation();
|
||||
if ("直发".equals(location)) {
|
||||
//todo 未入库 直接生产 直接生成出库记录并回传
|
||||
} else {
|
||||
//根据托盘码 判断是平库入库还是立体库入库
|
||||
//查询托盘入库货位
|
||||
List<BasStock> oldBasStockList = basStockService.selectBasStockByTrayCode(inStockTraycodeBindMsg.getTrayCode());
|
||||
//如果是4位数字 必须存在托盘对应库位 如果不是4位数字则证明是平库 货位就是托盘码
|
||||
if (CollUtil.isEmpty(oldBasStockList) && is4DigitNumber(inStockTraycodeBindMsg.getTrayCode())) {
|
||||
throw new RuntimeException(inStockTraycodeBindMsg.getTrayCode() + "尚未入库,查询不到库存");
|
||||
}
|
||||
//查询 合同号 产品号 代号 台次 物料编码 一致的老库存 进行数量合并
|
||||
Optional<BasStock> sameStock = oldBasStockList.stream().filter(x ->
|
||||
inStockinDetail.getSpare6().equals(x.getOrderId()) &&
|
||||
inStockinDetail.getSpare7().equals(x.getPower()) &&
|
||||
inStockinDetail.getSpare9().equals(x.getDistribution()) &&
|
||||
inStockinDetail.getSpare5().equals(x.getSpare5()) &&
|
||||
inStockinDetail.getProductId().equals(x.getProductId())
|
||||
).findFirst();
|
||||
if (sameStock.isPresent()) {
|
||||
//存在相同合同号 产品号 代号 台次 物料编码的库存
|
||||
BasStock basStock = sameStock.get();
|
||||
BigDecimal oldQuantity = Convert.toBigDecimal(basStock.getQuantity());
|
||||
BigDecimal quantity = inStockTraycodeBindMsg.getQuantity();
|
||||
BigDecimal newQuantity = oldQuantity.add(quantity);
|
||||
basStock.setQuantity(Convert.toStr(newQuantity));
|
||||
basStockService.updateBasStock(basStock);
|
||||
} else {
|
||||
//不存在,生成新库存
|
||||
BasStock stock = new BasStock();
|
||||
stock.setStockId(basJobIdService.getJobId("KC"));
|
||||
if (is4DigitNumber(inStockTraycodeBindMsg.getTrayCode())) {
|
||||
stock.setCargoSpaceId(oldBasStockList.get(0).getCargoSpaceId());
|
||||
} else {
|
||||
stock.setCargoSpaceId(inStockTraycodeBindMsg.getTrayCode());
|
||||
}
|
||||
stock.setStockStatus("1");
|
||||
stock.setOutQuantity("0");
|
||||
stock.setProductStatus("0");
|
||||
//stock.setLotNo(mydoJobDetail.getLotNo());
|
||||
stock.setInDate(DateUtil.formatDateTime(new Date()));
|
||||
stock.setProductGuid(inStockinDetail.getProductGuid());
|
||||
stock.setQuantity(Convert.toStr(inStockTraycodeBindMsg.getQuantity()));
|
||||
//stock.setJobId(mydoJob.getJobId());
|
||||
stock.setTrayCode(inStockTraycodeBindMsg.getTrayCode());
|
||||
stock.setWarehouseId(old.getWarehouseId());
|
||||
stock.setProductId(inStockinDetail.getProductId());
|
||||
stock.setStockinId(inStockinDetail.getStockinId());
|
||||
stock.setStockinDetailId(inStockinDetail.getStockinDetailId());
|
||||
stock.setInType(old.getInType());
|
||||
//stock.setLotNo(mydoJobDetail.getLotNo());
|
||||
stock.setProductName(inStockinDetail.getProductName());
|
||||
//合同号
|
||||
stock.setOrderId(inStockinDetail.getSpare6());
|
||||
//产品号
|
||||
stock.setPower(inStockinDetail.getSpare7());
|
||||
//代号
|
||||
stock.setDistribution(inStockinDetail.getSpare9());
|
||||
//台次
|
||||
stock.setSpare5(inStockinDetail.getSpare5());
|
||||
//部门
|
||||
stock.setModel(SecurityUtils.getDeptId().toString());
|
||||
basStockList.add(stock);
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除当前子单绑定信息
|
||||
inStockTraycodeBindMsgMapper.deleteInStockTraycodeBindMsgByInStockDetailId(inStockinDetail.getStockinDetailId());
|
||||
//修改子单入库数量
|
||||
iInStockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(basStockList)) {
|
||||
//插入库存
|
||||
basStockService.insertBasStockList(basStockList);
|
||||
|
||||
//删除新生成库存的托盘的空托盘库存记录
|
||||
basStockService.deleteKtpStockByList(basStockList, inStockin.getWarehouseId());
|
||||
}
|
||||
//插入回传信息
|
||||
if ("3".equals(old.getStockSource())){
|
||||
//插入MES上位系统回传表
|
||||
for (InStockinDetail inStockinDetail : list) {
|
||||
@@ -211,13 +324,31 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
}else if ("2".equals(old.getStockSource())){
|
||||
//插入ERP上位系统回传表
|
||||
}
|
||||
|
||||
//插入历史
|
||||
insertInStockinHistory(inStockin);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断字符串是否为4位数字
|
||||
*
|
||||
* @param str 待校验的字符串
|
||||
* @return true=是4位数字,false=不是
|
||||
*/
|
||||
public boolean is4DigitNumber(String str) {
|
||||
// 1. 先判空,避免空指针异常
|
||||
if (str == null) {
|
||||
return false;
|
||||
}
|
||||
// 2. 正则表达式 ^\\d{4}$ 含义:
|
||||
// ^ 表示字符串开始
|
||||
// \\d{4} 表示恰好4个数字(\\d代表数字,{4}表示数量为4)
|
||||
// $ 表示字符串结束
|
||||
return str.matches("^\\d{4}$");
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入入库单据 入库子单据历史
|
||||
* 删除入库单据
|
||||
@@ -261,4 +392,52 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
public List<InStockin> selectStockinByDetail(String stockinDetailId) {
|
||||
return inStockinMapper.selectStockinByDetail(stockinDetailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult productBack(List<ViewOutJobFlow> list) {
|
||||
|
||||
String warehouseId = list.get(0).getWarehouseId();
|
||||
InStockin inStockin = new InStockin();
|
||||
String rkdId = iBasJobIdService.getJobId("RKD");
|
||||
inStockin.setStockinGuid(rkdId);
|
||||
inStockin.setStockinId(rkdId);
|
||||
inStockin.setCreateDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||
inStockin.setCreateManId(Convert.toStr(SecurityUtils.getUserId()));
|
||||
inStockin.setDepartmentNo(Convert.toStr(SecurityUtils.getDeptId()));
|
||||
inStockin.setInType("3");
|
||||
inStockin.setWarehouseId(warehouseId);
|
||||
inStockin.setStatus("1");
|
||||
inStockin.setStockSource("0");
|
||||
inStockinMapper.insertInStockin(inStockin);
|
||||
for (int i = 1; i <= list.size(); i++) {
|
||||
ViewOutJobFlow viewOutJobFlow = list.get(i - 1);
|
||||
InStockinDetail inStockinDetail = new InStockinDetail();
|
||||
//合同号
|
||||
inStockinDetail.setSpare6(viewOutJobFlow.getContract());
|
||||
//产品号
|
||||
inStockinDetail.setSpare7(viewOutJobFlow.getCases());
|
||||
//代号
|
||||
inStockinDetail.setSpare9(viewOutJobFlow.getManagementNo());
|
||||
//台次
|
||||
inStockinDetail.setSpare5(viewOutJobFlow.getUnits());
|
||||
//物料编码
|
||||
inStockinDetail.setProductGuid(viewOutJobFlow.getProductId());
|
||||
inStockinDetail.setProductId(viewOutJobFlow.getProductId());
|
||||
//数量
|
||||
inStockinDetail.setQuantity(viewOutJobFlow.getOutQuantity());
|
||||
inStockinDetail.setStockinGuid(inStockin.getStockinGuid());
|
||||
inStockinDetail.setStockinDetailId(inStockin.getStockinId() + "-" + i);
|
||||
inStockinDetail.setStockinId(inStockin.getStockinId());
|
||||
iInStockinDetailService.insertInStockinDetail(inStockinDetail);
|
||||
|
||||
InStockTraycodeBindMsg bindMsg = new InStockTraycodeBindMsg();
|
||||
bindMsg.setInStockId(inStockin.getStockinId());
|
||||
bindMsg.setInStockDetailId(inStockinDetail.getStockinDetailId());
|
||||
bindMsg.setTrayCode(viewOutJobFlow.getTrayCode());
|
||||
bindMsg.setQuantity(Convert.toBigDecimal(inStockinDetail.getQuantity()));
|
||||
inStockTraycodeBindMsgMapper.insertInStockTraycodeBindMsg(bindMsg);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@ public class InStockinDetailController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/updateBatch")
|
||||
public AjaxResult updateBatch(@RequestBody List<InStockinDetail> inStockinDetailList) {
|
||||
return toAjax(inStockinDetailService.updateInStockinDetailList(inStockinDetailList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库单据子表列表
|
||||
*/
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.ruoyi.in.stockindetail.domain;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.domain.ExtraField;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入库单据子表对象 in_stockin_detail
|
||||
*
|
||||
@@ -150,4 +153,6 @@ public class InStockinDetail extends BaseEntity
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
private List<InStockTraycodeBindMsg> trayList;
|
||||
|
||||
}
|
||||
|
||||
@@ -81,4 +81,6 @@ public interface IInStockinDetailService
|
||||
|
||||
|
||||
public InStockinDetail selectStockinByDetailById(InStockinDetail inStockinDetail);
|
||||
|
||||
int updateInStockinDetailList(List<InStockinDetail> inStockinDetailList);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.ruoyi.in.stockindetail.service.impl;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.in.bind.domain.InStockTraycodeBindMsg;
|
||||
import com.ruoyi.in.bind.mapper.InStockTraycodeBindMsgMapper;
|
||||
import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.mapper.InStockinMapper;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.mapper.InStockinDetailMapper;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -23,6 +27,10 @@ public class InStockinDetailServiceImpl implements IInStockinDetailService
|
||||
{
|
||||
@Autowired
|
||||
private InStockinDetailMapper inStockinDetailMapper;
|
||||
@Autowired
|
||||
private InStockTraycodeBindMsgMapper inStockTraycodeBindMsgMapper;
|
||||
@Autowired
|
||||
private InStockinMapper inStockinMapper;
|
||||
|
||||
/**
|
||||
* 查询入库单据子表
|
||||
@@ -45,9 +53,6 @@ public class InStockinDetailServiceImpl implements IInStockinDetailService
|
||||
@Override
|
||||
public List<InStockinDetail> selectInStockinDetailList(InStockinDetail inStockinDetail)
|
||||
{
|
||||
/*for (InStockinDetail res : inStockinDetails) {
|
||||
res.setExtraField(JSONUtil.toBean(res.getSpare1(), ExtraField.class));
|
||||
}*/
|
||||
return inStockinDetailMapper.selectInStockinDetailList(inStockinDetail);
|
||||
}
|
||||
|
||||
@@ -123,8 +128,33 @@ public class InStockinDetailServiceImpl implements IInStockinDetailService
|
||||
@Override
|
||||
//@DataScope(warehouseAlias = "ist")
|
||||
public InStockinDetail selectStockinByDetailById(InStockinDetail inStockinDetail) {
|
||||
return inStockinDetailMapper.selectStockinByDetailById(inStockinDetail);
|
||||
}
|
||||
|
||||
return inStockinDetailMapper.selectStockinByDetailById(inStockinDetail);
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateInStockinDetailList(List<InStockinDetail> inStockinDetailList) {
|
||||
int i =0;
|
||||
if (CollUtil.isNotEmpty(inStockinDetailList)) {
|
||||
InStockin inStockin = new InStockin();
|
||||
inStockin.setStockinGuid(inStockinDetailList.get(0).getStockinGuid());
|
||||
inStockin.setStatus("3");
|
||||
inStockinMapper.updateInStockin(inStockin);
|
||||
for (InStockinDetail inStockinDetail : inStockinDetailList) {
|
||||
List<InStockTraycodeBindMsg> trayList = inStockinDetail.getTrayList();
|
||||
if (CollUtil.isNotEmpty(trayList)) {
|
||||
inStockTraycodeBindMsgMapper.deleteInStockTraycodeBindMsgByInStockDetailId(inStockinDetail.getStockinDetailId());
|
||||
for (InStockTraycodeBindMsg inStockTraycodeBindMsg : trayList) {
|
||||
inStockTraycodeBindMsg.setInStockDetailId(inStockinDetail.getStockinDetailId());
|
||||
inStockTraycodeBindMsg.setInStockId(inStockinDetail.getStockinId());
|
||||
i += inStockTraycodeBindMsgMapper.insertInStockTraycodeBindMsg(inStockTraycodeBindMsg);
|
||||
}
|
||||
inStockinDetailMapper.updateInStockinDetail(inStockinDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ public class OutMydoJobController extends BaseController {
|
||||
return mydoJobService.pointOut(stockIds,exitId,type);
|
||||
}
|
||||
|
||||
@Log(title = "指定排列层出库", businessType = BusinessType.INSERT)
|
||||
@RequestMapping("/cargoSpaceOut")
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:outmydoJob:cargoSpaceOut,job:outmydoJob:cargoSpaceOut1,job:outmydoJob:cargoSpaceOut2')")
|
||||
public AjaxResult cargoSpaceOut(@RequestParam("exitId")String exitId,@RequestParam("warehouseId")String warehouseId,@RequestParam("cargoSpaceId")String cargoSpaceId)
|
||||
{
|
||||
return mydoJobService.cargoSpaceOut(warehouseId,cargoSpaceId,exitId);
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "修改优先级",businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updatePriority")
|
||||
|
||||
@@ -74,4 +74,6 @@ public interface MydoJobMapper
|
||||
MydoJob selectByTrayCode(String trayCode);
|
||||
|
||||
MydoJob selectMydoJobByEntranceId(MydoJob mydoJob);
|
||||
|
||||
void cargoSpaceOut(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@@ -113,4 +113,8 @@ public interface IMydoJobService
|
||||
AjaxResult manualCompletedCheckMydoJob(MydoJob mydoJob, int i);
|
||||
|
||||
AjaxResult updatePriority(MydoJob mydoJob);
|
||||
|
||||
public void insertHistory(String jobId) ;
|
||||
|
||||
AjaxResult cargoSpaceOut(String warehouseId, String cargoSpaceId, String exitId);
|
||||
}
|
||||
|
||||
@@ -291,13 +291,26 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
*
|
||||
* @param jobId
|
||||
*/
|
||||
private void insertHistory(String jobId) {
|
||||
public void insertHistory(String jobId) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
mydoJobDetailService.insertHistory(jobId);
|
||||
mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
mydoJobDetailService.deleteMydoJobDetailByJobId(jobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult cargoSpaceOut(String warehouseId, String cargoSpaceId, String exitId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_warehouse_id", warehouseId);
|
||||
map.put("v_exit_id", exitId);
|
||||
map.put("v_cargo_space_id", cargoSpaceId);
|
||||
mydoJobMapper.cargoSpaceOut(map);
|
||||
if (!"10".equals(Convert.toStr(map.get("v_result")))) {
|
||||
return AjaxResult.error(Convert.toStr(map.get("v_resultmsg")));
|
||||
}
|
||||
return AjaxResult.success(map.get("v_resultmsg"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动完成任务表
|
||||
*/
|
||||
|
||||
@@ -75,4 +75,10 @@ public interface BasStockMapper
|
||||
int updateBasStockDept(BasStock basStock);
|
||||
|
||||
int selectCountByTrayCodeAndWarehouseId(String trayCode, String warehouseId);
|
||||
|
||||
List<BasStock> selectBasStockByTrayCode(String trayCode);
|
||||
|
||||
void deleteKtpStockByList(@Param("list") List<BasStock> basStockList,@Param("warehouseId")String warehouseId);
|
||||
|
||||
void deleteKtpStockByTrayCodeAndWarehouseId(@Param("trayCode") String trayCode, @Param("warehouseId") String warehouseId);
|
||||
}
|
||||
|
||||
@@ -86,4 +86,10 @@ public interface IBasStockService
|
||||
List<BasStockSummary> selectBasStockSummary(BasStock basStock);
|
||||
|
||||
AjaxResult updateBasStockDept(BasStock basStock);
|
||||
|
||||
List<BasStock> selectBasStockByTrayCode(String trayCode);
|
||||
|
||||
void deleteKtpStockByList(List<BasStock> basStockList,String warehouseId);
|
||||
|
||||
void deleteKtpStockByTrayCodeAndWarehouseId(String trayCode, String warehouseId);
|
||||
}
|
||||
|
||||
@@ -470,6 +470,21 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasStock> selectBasStockByTrayCode(String trayCode) {
|
||||
return basStockMapper.selectBasStockByTrayCode(trayCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteKtpStockByList(List<BasStock> basStockList,String warehouseId) {
|
||||
basStockMapper.deleteKtpStockByList(basStockList,warehouseId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteKtpStockByTrayCodeAndWarehouseId(String trayCode, String warehouseId) {
|
||||
basStockMapper.deleteKtpStockByTrayCodeAndWarehouseId(trayCode,warehouseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存信息(不记录维护记录)
|
||||
*
|
||||
|
||||
@@ -42,16 +42,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<!-- <association property="extraField" javaType="ExtraField">-->
|
||||
<!-- <result property="productId" column="product_id" />-->
|
||||
<!-- <result property="materialDesc" column="product_name" />-->
|
||||
<!-- <result property="englishDesc" column="englishDesc" />-->
|
||||
<!-- <result property="length" column="length" />-->
|
||||
<!-- <result property="width" column="width" />-->
|
||||
<!-- <result property="height" column="height" />-->
|
||||
<!-- <result property="volume" column="volume" />-->
|
||||
<!-- <result property="netWeight" column="netWeight" />-->
|
||||
<!-- </association>-->
|
||||
<collection
|
||||
property="trayList"
|
||||
javaType="java.util.List"
|
||||
ofType="InStockTraycodeBindMsg">
|
||||
<result property="id" column="bind_msg_id"/>
|
||||
<result property="quantity" column="traycode_quantity"/>
|
||||
<result property="trayCode" column="tray_code"/>
|
||||
<result property="location" column="location"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInStockinDetailVo">
|
||||
@@ -62,8 +61,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
isd.supplier_id, isd.customer_id, bp.unit, bp.spec, isd.spare1, isd.spare2, isd.spare3, isd.spare4,
|
||||
isd.spare5, isd.spare6, isd.scan_num, isd.scan_num_x, isd.scan_num_j,
|
||||
bp.product_name,
|
||||
isd.spare7,isd.spare8,isd.spare9,bs.supplier_name
|
||||
isd.spare7,
|
||||
isd.spare8,
|
||||
isd.spare9,
|
||||
bs.supplier_name,
|
||||
istbm.tray_code,
|
||||
istbm.location,
|
||||
istbm.quantity as traycode_quantity,
|
||||
istbm.id as bind_msg_id
|
||||
from in_stockin_detail isd
|
||||
left join in_stock_traycode_bind_msg istbm on isd.stockin_detail_id = istbm.in_stock_detail_id
|
||||
left join bas_product bp on bp.product_id = isd.product_id
|
||||
left join bas_supplier bs on bs.supplier_no = isd.supplier_id
|
||||
</sql>
|
||||
|
||||
@@ -238,4 +238,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="lineId != null and lineId != ''"> and mj.line_id = #{lineId}</if>
|
||||
order by mj.create_time
|
||||
</select>
|
||||
<select id="cargoSpaceOut" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_exception_cargo_space_out(
|
||||
#{v_warehouse_id,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_exit_id,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_cargo_space_id,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -322,6 +322,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{stockId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteKtpStockByList">
|
||||
delete from bas_stock
|
||||
where tray_code in
|
||||
<foreach collection="list" index="i" open="(" close=")" item="it" separator=",">
|
||||
#{it.trayCode}
|
||||
</foreach>
|
||||
and product_guid = 'KTP0001' and warehouse_id = #{warehouseId}
|
||||
</delete>
|
||||
<delete id="deleteKtpStockByTrayCodeAndWarehouseId">
|
||||
delete from bas_stock
|
||||
where tray_code = #{trayCode} and warehouse_id = #{warehouseId}
|
||||
</delete>
|
||||
|
||||
<select id="selectKtpStock" parameterType="BasStock" resultMap="BasStockResult">
|
||||
select b.cargo_space_name, b.cargo_space_id from bas_stock s,bas_cargo_space b
|
||||
@@ -335,24 +347,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by b.the_platoon,b.the_floor,b.the_column asc
|
||||
</select>
|
||||
<select id="selectBasStockSummary" resultType="com.ruoyi.stock.stock.domain.BasStockSummary">
|
||||
select DISTINCT bs.warehouse_id as warehouseId,
|
||||
bw.warehouse_name as warehouseName,
|
||||
bs.cargo_space_id as cargoSpaceId,
|
||||
bcs.cargo_space_name as cargoSpaceName,
|
||||
bs.tray_code as trayCode,
|
||||
bs.model as model,
|
||||
bcs.roadway_id as roadwayId,
|
||||
bcs.the_platoon as thePlatoon,
|
||||
bcs.the_column as theColumn,
|
||||
bcs.the_floor as theFloor,
|
||||
bcs.the_type as theType,
|
||||
bcs.the_type_name as theTypeName
|
||||
from bas_stock bs
|
||||
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id and bs.tray_code = bcs.tray_code
|
||||
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
|
||||
left join bas_product bp on bs.product_id = bp.product_id
|
||||
left join sys_dept sd on bs.model = sd.dept_id
|
||||
WHERE bcs.status = '2'
|
||||
SELECT DISTINCT
|
||||
bs.warehouse_id AS warehouseId,
|
||||
bw.warehouse_name AS warehouseName,
|
||||
bs.cargo_space_id AS cargoSpaceId,
|
||||
CASE
|
||||
WHEN bcs.cargo_space_name IS NULL THEN '平库'
|
||||
ELSE bcs.cargo_space_name
|
||||
END AS cargoSpaceName,
|
||||
bs.tray_code AS trayCode,
|
||||
bs.model AS model,
|
||||
bcs.roadway_id AS roadwayId,
|
||||
bcs.the_platoon AS thePlatoon,
|
||||
bcs.the_column AS theColumn,
|
||||
bcs.the_floor AS theFloor,
|
||||
bcs.the_type AS theType,
|
||||
bcs.the_type_name AS theTypeName
|
||||
FROM bas_stock bs
|
||||
LEFT JOIN bas_cargo_space bcs ON bs.cargo_space_id = bcs.cargo_space_id AND bs.tray_code = bcs.tray_code
|
||||
LEFT JOIN bas_warehouse bw ON bs.warehouse_id = bw.warehouse_id
|
||||
LEFT JOIN bas_product bp ON bs.product_id = bp.product_id
|
||||
LEFT JOIN sys_dept sd ON bs.model = sd.dept_id
|
||||
WHERE (bcs.status = '2' OR bs.cargo_space_id = bs.tray_code)
|
||||
<if test="model != null and model != ''">
|
||||
and (bs.model = #{model} or bs.model is null or bs.model = '')
|
||||
</if>
|
||||
@@ -401,4 +417,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectCountByTrayCodeAndWarehouseId" resultType="java.lang.Integer">
|
||||
select count(1) from bas_stock where tray_code = #{trayCode} and warehouse_id = #{warehouseId}
|
||||
</select>
|
||||
<select id="selectBasStockByTrayCode" resultMap="BasStockResult">
|
||||
<include refid="selectBasStockVo"/>
|
||||
where bs.tray_code = #{trayCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.in.bind.mapper.InStockTraycodeBindMsgMapper">
|
||||
|
||||
<resultMap type="InStockTraycodeBindMsg" id="InStockTraycodeBindMsgResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="inStockId" column="in_stock_id" />
|
||||
<result property="inStockDetailId" column="in_stock_detail_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="location" column="location" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare4" column="spare4" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInStockTraycodeBindMsgVo">
|
||||
select id, in_stock_id, in_stock_detail_id, tray_code, quantity, location, spare1, spare2, spare3, spare4 from in_stock_traycode_bind_msg
|
||||
</sql>
|
||||
|
||||
<select id="selectInStockTraycodeBindMsgList" parameterType="InStockTraycodeBindMsg" resultMap="InStockTraycodeBindMsgResult">
|
||||
<include refid="selectInStockTraycodeBindMsgVo"/>
|
||||
<where>
|
||||
<if test="inStockId != null and inStockId != ''"> and in_stock_id = #{inStockId}</if>
|
||||
<if test="inStockDetailId != null and inStockDetailId != ''"> and in_stock_detail_id = #{inStockDetailId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="location != null and location != ''"> and location = #{location}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInStockTraycodeBindMsgById" parameterType="Long" resultMap="InStockTraycodeBindMsgResult">
|
||||
<include refid="selectInStockTraycodeBindMsgVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectModelByTrayCode" resultType="com.ruoyi.in.stockin.domain.TrayCodeModel">
|
||||
select distinct model,tray_code
|
||||
from bas_stock
|
||||
where tray_code in (
|
||||
select distinct tray_code from in_stock_traycode_bind_msg
|
||||
where in_stock_id = #{stockinGuid}
|
||||
)
|
||||
</select>
|
||||
|
||||
<insert id="insertInStockTraycodeBindMsg" parameterType="InStockTraycodeBindMsg" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into in_stock_traycode_bind_msg
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="inStockId != null">in_stock_id,</if>
|
||||
<if test="inStockDetailId != null">in_stock_detail_id,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="location != null">location,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="inStockId != null">#{inStockId},</if>
|
||||
<if test="inStockDetailId != null">#{inStockDetailId},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="location != null">#{location},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInStockTraycodeBindMsg" parameterType="InStockTraycodeBindMsg">
|
||||
update in_stock_traycode_bind_msg
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="inStockId != null">in_stock_id = #{inStockId},</if>
|
||||
<if test="inStockDetailId != null">in_stock_detail_id = #{inStockDetailId},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="location != null">location = #{location},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInStockTraycodeBindMsgById" parameterType="Long">
|
||||
delete from in_stock_traycode_bind_msg where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInStockTraycodeBindMsgByIds" parameterType="String">
|
||||
delete from in_stock_traycode_bind_msg where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteInStockTraycodeBindMsgByInStockDetailId">
|
||||
delete from in_stock_traycode_bind_msg where in_stock_detail_id = #{inStockDetailId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -67,4 +67,13 @@ export function confirmationStockIn(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 退料入库
|
||||
export function productBack(data) {
|
||||
return request({
|
||||
url: '/in/stockIn/productBack',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,3 +50,12 @@ export function barcodePrinting(data) {
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量修改入库单据子表
|
||||
export function updateStockInDetailBatch(data) {
|
||||
return request({
|
||||
url: '/in/stockInDetail/updateBatch',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -54,3 +54,12 @@ export function updateOutJobPriority(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 货位出库生成任务
|
||||
export function cargoSpaceOut(params) {
|
||||
return request({
|
||||
url: '/job/outmydoJob/cargoSpaceOut',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -435,7 +435,9 @@ export default {
|
||||
/** 获取子单据列表 */
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
if (typeof stockinId === 'string' || typeof stockinId === 'number') {
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
}
|
||||
this.queryDetailParams.status = this.queryParams.status;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
@@ -445,13 +447,7 @@ export default {
|
||||
},
|
||||
//主单点击触发事件
|
||||
handleRowClick(selection) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
this.getDetailList(selection.stockinId);
|
||||
},
|
||||
// 删除子单据按钮操作
|
||||
handleStockinDetailDelete(row) {
|
||||
|
||||
@@ -1,196 +1,176 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="入库单据" prop="stockinGuid"><!--入库订单ID-->
|
||||
<el-input
|
||||
v-model="queryParams.stockinGuid"
|
||||
placeholder="请输入入库单据编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialDesc"><!--物料描述-->
|
||||
<el-input
|
||||
v-model="queryParams.materialDesc"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="app-container" style="background-color: #f0f2f5; padding: 20px; min-height: calc(100vh - 84px);">
|
||||
<!-- 查询区域卡片 -->
|
||||
<el-card shadow="never" style="margin-bottom: 15px; border: none;">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" style="margin-bottom: -15px;">
|
||||
<el-form-item label="入库单据" prop="stockinGuid">
|
||||
<el-input v-model="queryParams.stockinGuid" placeholder="请输入入库单据编码" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialDesc">
|
||||
<el-input v-model="queryParams.materialDesc" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" prop="inType">
|
||||
<el-select v-model="queryParams.inType" placeholder="请选择入库类型" clearable>
|
||||
<el-option v-for="dict in dict.type.in_bill_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态">
|
||||
<el-option v-for="dict in dict.type.in_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-form-item label="入库类型" prop="inType"><!--入库类型-->
|
||||
<el-select v-model="queryParams.inType" placeholder="请选择入库类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.in_bill_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status"><!--单据状态-->
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.in_bill_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><!--搜索-->
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button><!--重置-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 主表区域卡片 -->
|
||||
<el-card shadow="never" style="margin-bottom: 15px; border: none;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-weight: bold; color: #333;">主单列表</span>
|
||||
<div style="float: right;">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="single" @click="handleInvalidated" v-hasPermi="['in:stockIn:edit']">单据作废</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleReview" v-hasPermi="['in:stockIn:edit']">单据审核</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleConfirmation" v-hasPermi="['in:stockIn:edit']">单据确认</el-button>
|
||||
<el-button type="info" plain icon="el-icon-download" size="mini" :disabled="detailMultiple" @click="handleBarcodePrinting" v-hasPermi="['in:stockIn:barcodePrinting']">打印条码</el-button>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" style="margin-left: 10px;"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleInvalidated"
|
||||
v-hasPermi="['in:stockIn:edit']"
|
||||
>单据作废<!--单据作废-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleReview"
|
||||
v-hasPermi="['in:stockIn:edit']"
|
||||
>单据审核<!--单据审核-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleConfirmation"
|
||||
v-hasPermi="['in:stockIn:edit']"
|
||||
>单据确认<!--单据确认-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="detailMultiple"
|
||||
@click="handleBarcodePrinting"
|
||||
v-hasPermi="['in:stockIn:barcodePrinting']"
|
||||
>打印条码<!--打印条码-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" max-height="300" border highlight-current-row :row-class-name="tableRowClassName">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="入库订单" align="left" prop="stockinId" width="150"/>
|
||||
<el-table-column label="入库类型" align="left" prop="inType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_type" :value="scope.row.inType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上位单号" align="left" prop="erpBill" width="150"/>
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName"/>
|
||||
<el-table-column label="部门" align="left" prop="departmentName"/>
|
||||
<el-table-column label="建立时间" align="left" prop="createDate" width="160"/>
|
||||
<el-table-column label="备注" align="left" prop="spare5" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" v-if="false"/>
|
||||
<el-table-column label="入库订单" align="left" prop="stockinId" width="150"/><!--入库订单-->
|
||||
<el-table-column label="入库类型" align="left" prop="inType"><!--入库类型-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_type" :value="scope.row.inType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="left" prop="status"><!--单据状态-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据来源" align="left" prop="stockSource"><!--单据来源-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.bill_resource" :value="scope.row.stockSource"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上位单号" align="left" prop="erpBill" width="150"/><!--入库订单-->
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName"/><!--仓库-->
|
||||
<el-table-column label="创建人" align="left" prop="createManName"/><!--创建人-->
|
||||
<el-table-column label="部门" align="left" prop="departmentName"/><!--部门-->
|
||||
<el-table-column label="建立时间" align="left" prop="createDate" width="160"/><!--建立时间-->
|
||||
<el-table-column label="完成日期" align="left" prop="finishDate" width="160"/><!--完成日期-->
|
||||
<el-table-column label="备注" align="left" prop="spare5"/><!--备注-->
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
style="padding: 10px 0 0 0;"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 子表区域卡片 -->
|
||||
<el-card shadow="never" style="border: none;" v-if="queryDetailParams.stockinId">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-weight: bold; color: #333;">
|
||||
子单明细 <span style="font-weight: normal; color: #999; font-size: 13px; margin-left: 10px;">(当前主单: {{ queryDetailParams.stockinId }})</span>
|
||||
</span>
|
||||
<div style="float: right; display: flex; align-items: center;">
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="handleBatchSave" v-hasPermi="['in:stockIn:edit']">暂存子单明细</el-button>
|
||||
<div style="width: 1px; height: 20px; background: #eee; margin: 0 15px;"></div>
|
||||
<el-input v-model="batchTrayCode" placeholder="批量条码" size="mini" style="width: 120px; margin-right: 5px;" clearable />
|
||||
<el-button type="warning" size="mini" icon="el-icon-copy-document" @click="handleBatchFillTrayCode">批量填充</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleDetailSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="left" prop="stockinDetailId" width="160"/><!--子单ID-->
|
||||
<el-table-column label="主单ID" align="left" prop="stockinId" width="160"/><!--主单ID-->
|
||||
<el-table-column label="合同号" align="left" prop="spare6"/>
|
||||
<el-table-column label="产品号" align="left" prop="spare7"/>
|
||||
<el-table-column label="代号" align="left" prop="spare9"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5"/>
|
||||
<el-table-column label="物料编码" align="left" prop="productId"/><!--物料编码-->
|
||||
<el-table-column label="物料名称" align="left" prop="productName" width="160"/><!--物料编码-->
|
||||
<el-table-column label="供应商" align="left" prop="supplierName" width="160"/><!--供应商-->
|
||||
<el-table-column label="规格型号" align="left" prop="spec" width="160"/>
|
||||
<el-table-column label="计划数量" align="right" prop="quantity"/><!--计划数量-->
|
||||
<el-table-column label="扫码数量" align="right" prop="scanNum"/><!--扫码数量-->
|
||||
<el-table-column label="实际数量" align="right" prop="assignNum"/><!--实际数量-->
|
||||
<el-table
|
||||
v-loading="detailLoading"
|
||||
:data="stockInDetailList"
|
||||
@selection-change="handleDetailSelectionChange"
|
||||
row-key="stockinDetailId"
|
||||
max-height="500"
|
||||
class="detail-table"
|
||||
border
|
||||
:row-class-name="detailTableRowClassName"
|
||||
>
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<div class="tray-manage-box">
|
||||
<div class="tray-header">
|
||||
<i class="el-icon-info"></i> 托盘分配管理
|
||||
<el-button type="text" icon="el-icon-plus" @click="addTray(props.row)" style="margin-left: 20px;">添加托盘</el-button>
|
||||
</div>
|
||||
<el-table :data="props.row.trayList" size="mini" border stripe style="width: 100%; margin-top: 10px;">
|
||||
<el-table-column label="托盘条码" prop="trayCode">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.trayCode" placeholder="请输入托盘码" size="mini" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分盘数量" prop="quantity" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="calculateAssignNum(props.row)" style="width: 130px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="存放位置" prop="location">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.location" placeholder="请输入存放位置" size="mini" clearable />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-delete" @click="removeTray(props.row, scope.$index)" style="color: #F56C6C">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="合同号" align="left" prop="spare6" width="120"/>
|
||||
<el-table-column label="代号" align="left" prop="spare9" width="100"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5" width="80"/>
|
||||
<el-table-column label="物料编码" align="left" prop="productId" width="120"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName" show-overflow-tooltip/>
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" width="100"/>
|
||||
<el-table-column label="实际数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<b :style="{color: scope.row.assignNum > scope.row.quantity ? '#F56C6C' : '#409EFF'}">{{ scope.row.assignNum }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘明细 (条码/数量/位置)" align="left" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.trayList && scope.row.trayList.length > 0" class="tray-summary-list">
|
||||
<el-tag
|
||||
v-for="(tray, index) in scope.row.trayList"
|
||||
:key="index"
|
||||
size="mini"
|
||||
type="success"
|
||||
effect="light"
|
||||
class="tray-summary-tag"
|
||||
>
|
||||
<i class="el-icon-receiving"></i>
|
||||
<b>{{ tray.trayCode || '无条码' }}</b>
|
||||
<span class="qty-split">|</span>
|
||||
<span style="color: #67C23A">{{ tray.quantity }}</span>
|
||||
<span v-if="tray.location" class="loc-split">-</span>
|
||||
<span v-if="tray.location" class="loc-text">{{ tray.location }}</span>
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-tag v-else size="mini" type="info" effect="plain">未分配托盘</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- <el-table-column label="生产图号" align="left" prop="cargoNo" />-->
|
||||
<!-- <el-table-column label="单位" align="left" prop="unit" />-->
|
||||
<!-- <el-table-column label="来源" align="left" prop="spare1"><!–来源–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="left" prop="spare2">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spare2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="套账" align="left" prop="spare3"><!–套账–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用途" align="left" prop="spare4"><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare4"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
|
||||
<!-- <el-table-column label="批次" align="left" prop="lotNo"/>-->
|
||||
<!-- <el-table-column label="单价" align="left" prop="price"/>-->
|
||||
|
||||
<!-- <el-table-column label="质量" align="left" prop="spare8"><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="queryDetailParams.pageNum"
|
||||
:limit.sync="queryDetailParams.pageSize"
|
||||
@pagination="getDetailList"
|
||||
/>
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="queryDetailParams.pageNum"
|
||||
:limit.sync="queryDetailParams.pageSize"
|
||||
@pagination="getDetailList"
|
||||
style="padding: 10px 0 0 0;"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 绑定托盘对话框 -->
|
||||
<el-dialog :title="'绑定托盘'" :visible.sync="bindOpen" width="600px" append-to-body>
|
||||
@@ -239,7 +219,7 @@
|
||||
|
||||
<script>
|
||||
import {confirmationStockIn, invalidatedStockIn, listStockIn, reviewStockIn} from "@/api/in/stockIn"
|
||||
import {listStockInDetail} from "@/api/in/stockInDetail"
|
||||
import {listStockInDetail, updateStockInDetailBatch} from "@/api/in/stockInDetail"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import VueQr from 'vue-qr'
|
||||
@@ -308,6 +288,8 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 批量填充托盘条码
|
||||
batchTrayCode: '',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -541,34 +523,190 @@ export default {
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
/** 批量填充托盘条码 */
|
||||
handleBatchFillTrayCode() {
|
||||
if (!this.batchTrayCode) {
|
||||
this.$modal.msgWarning("请输入批量托盘条码");
|
||||
return;
|
||||
}
|
||||
if (this.stockInDetailListSelected.length === 0) {
|
||||
this.$modal.msgWarning("请选择要填充的子单据");
|
||||
return;
|
||||
}
|
||||
// 批量填充逻辑:为每个选中行添加或设置一个托盘,数量默认为计划数量或剩余数量
|
||||
this.stockInDetailList.forEach((item, index) => {
|
||||
if (this.stockInDetailListSelected.some(selected => selected.stockinDetailId === item.stockinDetailId)) {
|
||||
// 如果没有 trayList,初始化
|
||||
if (!item.trayList) {
|
||||
this.$set(this.stockInDetailList[index], 'trayList', []);
|
||||
}
|
||||
const remain = Math.max(0, (item.quantity || 0) - (item.assignNum || 0));
|
||||
// 查找是否已有该托盘,没有则添加,有则更新数量
|
||||
const existingTray = item.trayList.find(t => t.trayCode === this.batchTrayCode);
|
||||
if (!existingTray) {
|
||||
item.trayList.push({
|
||||
trayCode: this.batchTrayCode,
|
||||
quantity: remain, // 默认填入剩余计划数量
|
||||
location: ''
|
||||
});
|
||||
} else {
|
||||
existingTray.quantity = (existingTray.quantity || 0) + remain;
|
||||
}
|
||||
this.calculateAssignNum(item);
|
||||
}
|
||||
});
|
||||
this.$modal.msgSuccess("填充成功");
|
||||
},
|
||||
/** 添加托盘行 */
|
||||
addTray(row) {
|
||||
if (!row.trayList) {
|
||||
this.$set(row, 'trayList', []);
|
||||
}
|
||||
const remain = Math.max(0, (row.quantity || 0) - (row.assignNum || 0));
|
||||
row.trayList.push({
|
||||
trayCode: '',
|
||||
quantity: remain,
|
||||
location: ''
|
||||
});
|
||||
this.calculateAssignNum(row);
|
||||
},
|
||||
/** 删除托盘行 */
|
||||
removeTray(row, index) {
|
||||
row.trayList.splice(index, 1);
|
||||
this.calculateAssignNum(row);
|
||||
},
|
||||
/** 计算合计实际数量 */
|
||||
calculateAssignNum(row) {
|
||||
if (!row.trayList) return;
|
||||
const total = row.trayList.reduce((sum, tray) => sum + (tray.quantity || 0), 0);
|
||||
this.$set(row, 'assignNum', total);
|
||||
},
|
||||
/** 批量保存子单修改 */
|
||||
handleBatchSave() {
|
||||
if (this.stockInDetailList.length === 0) {
|
||||
this.$modal.msgWarning('没有子单数据可以保存')
|
||||
return
|
||||
}
|
||||
this.$modal.confirm('是否确认保存当前所有子单的修改?').then(() => {
|
||||
return updateStockInDetailBatch(this.stockInDetailList)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('保存成功')
|
||||
this.getDetailList(this.queryDetailParams.stockinId)
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
if (typeof stockinId === 'string' || typeof stockinId === 'number') {
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
}
|
||||
this.queryDetailParams.status = this.queryParams.status;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.stockInDetailList = response.rows.map(item => {
|
||||
const trayList = item.trayList || [];
|
||||
const assignNum = trayList.reduce((sum, tray) => sum + (tray.quantity || 0), 0);
|
||||
return {
|
||||
...item,
|
||||
trayList: trayList,
|
||||
assignNum: assignNum // 初始化合计数量
|
||||
};
|
||||
});
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
handleRowClick(selection) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
this.getDetailList(selection.stockinId);
|
||||
},
|
||||
/** 主单列表行高亮 */
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
if (this.queryDetailParams.stockinId === row.stockinId) {
|
||||
return 'current-row';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
/** 子单列表行颜色 */
|
||||
detailTableRowClassName({row, rowIndex}) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'detail-row-even';
|
||||
} else {
|
||||
return 'detail-row-odd';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-table >>> .detail-row-even {
|
||||
background-color: #f0f9ff !important;
|
||||
}
|
||||
.detail-table >>> .detail-row-odd {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
/* 每一行底部增加分割线,增强组的感觉 */
|
||||
.detail-table >>> .el-table__row > td {
|
||||
border-bottom: 2px solid #e6ebf5 !important;
|
||||
}
|
||||
/* 展开行底部及左侧增加粗边框,强化组的感觉 */
|
||||
.detail-table >>> .el-table__expanded-cell {
|
||||
border-bottom: 3px solid #409EFF !important;
|
||||
border-left: 5px solid #409EFF !important;
|
||||
padding: 10px 50px !important;
|
||||
}
|
||||
/* 确保展开行背景色同步父行 */
|
||||
.detail-table >>> .detail-row-even + tr > .el-table__expanded-cell {
|
||||
background-color: #f0f9ff !important;
|
||||
}
|
||||
.detail-table >>> .detail-row-odd + tr > .el-table__expanded-cell {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
.tray-manage-box {
|
||||
padding: 15px 20px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #409EFF;
|
||||
border-radius: 4px;
|
||||
margin: 10px 0;
|
||||
box-shadow: 0 4px 12px 0 rgba(64, 158, 255, 0.2);
|
||||
}
|
||||
.tray-header {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #606266;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.tray-header i {
|
||||
margin-right: 5px;
|
||||
color: #409EFF;
|
||||
}
|
||||
/* 托盘明细摘要样式 */
|
||||
.tray-summary-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
.tray-summary-tag {
|
||||
border-radius: 4px;
|
||||
padding: 0 8px;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.qty-split {
|
||||
margin: 0 5px;
|
||||
color: #dcdfe6;
|
||||
}
|
||||
.loc-split {
|
||||
margin: 0 4px;
|
||||
color: #909399;
|
||||
}
|
||||
.loc-text {
|
||||
font-weight: normal;
|
||||
color: #909399;
|
||||
}
|
||||
.el-form-item >>> .el-form-item__label {
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
min-width: fit-content;
|
||||
font-weight: bold;
|
||||
}
|
||||
/* 打印样式 */
|
||||
.vue-easy-print {
|
||||
|
||||
408
ruoyi-ui/src/views/out/cargoSpaceOut.vue
Normal file
408
ruoyi-ui/src/views/out/cargoSpaceOut.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="labelWidthForSearch">
|
||||
|
||||
|
||||
<el-form-item label="巷道" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 排 -->
|
||||
<el-form-item label="排" prop="thePlatoon">
|
||||
<el-input
|
||||
v-model="queryParams.thePlatoon"
|
||||
placeholder="请输入排"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 列 -->
|
||||
<el-form-item label="列" prop="theColumn">
|
||||
<el-input
|
||||
v-model="queryParams.theColumn"
|
||||
placeholder="请输入列"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 层 -->
|
||||
<el-form-item label="层" prop="theFloor">
|
||||
<el-input
|
||||
v-model="queryParams.theFloor"
|
||||
placeholder="请输入层"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<!-- 【查询】按钮 -->
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(1)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut']"
|
||||
>指定出库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(1)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut1']"
|
||||
>入库端出库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(2)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut2']"
|
||||
>出库端出库</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="cargoSpaceList" @selection-change="handleSelectionChange" max-height="650">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 货位ID -->
|
||||
<el-table-column label="货位编号" align="left" prop="cargoSpaceId" />
|
||||
<!-- 仓库名称 -->
|
||||
<!-- <el-table-column label="仓库名称" align="left" prop="warehouseName" />-->
|
||||
<el-table-column label="巷道ID" align="left" prop="roadwayId" />
|
||||
<!-- 货位名称 -->
|
||||
<el-table-column label="货位名称" align="center" prop="cargoSpaceName" />
|
||||
<!-- 排 -->
|
||||
<el-table-column label="排" align="left" prop="thePlatoon" />
|
||||
<!-- 列 -->
|
||||
<el-table-column label="列" align="left" prop="theColumn" />
|
||||
<!-- 层 -->
|
||||
<el-table-column label="层" align="left" prop="theFloor" />
|
||||
<!-- 货位编码 -->
|
||||
<el-table-column label="货位状态" align="left" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 是否锁定 -->
|
||||
<el-table-column label="锁定状态" align="left" prop="locked" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.locked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 托盘编码 -->
|
||||
<el-table-column label="托盘编号" align="left" prop="trayCode" />
|
||||
<!-- 货物高度 -->
|
||||
<el-table-column label="货物高度(MM)" align="left" prop="cargoHight" />
|
||||
<!-- 货物重量 -->
|
||||
<el-table-column label="货位重量(KG)" align="left" prop="theType" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCargoSpace, getCargoSpace, delCargoSpace, addCargoSpace, updateCargoSpace } from "@/api/bas/cargoSpace"
|
||||
import { listWarehouse } from "@/api/bas/warehouse"
|
||||
import { cargoSpaceOut } from "@/api/job/OutmydoJob"
|
||||
|
||||
export default {
|
||||
name: "CargoSpace",
|
||||
dicts:['cargo_space_status','cargo_space_lock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 选中行数据
|
||||
selection: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 库存信息表格数据
|
||||
cargoSpaceList: [],
|
||||
warehouseOptions:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
cargoSpaceId: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
cargoSpaceId: [
|
||||
// 校验---货位ID是否为空
|
||||
{ required: true, message: "请输入货位编号", trigger: "blur" }
|
||||
],
|
||||
warehouseId: [
|
||||
// 校验---仓库是否为空
|
||||
{ required: true, message: "请选择仓库", trigger: "change" }
|
||||
],
|
||||
cargoSpaceName: [
|
||||
// 校验---货位名称是否为空
|
||||
{ required: true, message: "请输入货位名称", trigger: "blur" }
|
||||
],
|
||||
thePlatoon: [
|
||||
// 校验---排是否为空
|
||||
{ required: true, message: "请输入排号", trigger: "blur" }
|
||||
],
|
||||
theColumn: [
|
||||
// 校验---列是否为空
|
||||
{ required: true, message: "请输入列号", trigger: "blur" }
|
||||
],
|
||||
theFloor: [
|
||||
// 校验---层是否为空
|
||||
{ required: true, message: "请输入层号", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
// 校验---货位状态是否为空
|
||||
{ required: true, message: "请选择货位状态", trigger: "change" }
|
||||
],
|
||||
locked: [
|
||||
// 校验---锁定状态是否为空
|
||||
{ required: true, message: "请选择锁定状态", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loading = false
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询库存信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCargoSpace(this.queryParams).then(response => {
|
||||
this.cargoSpaceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
cargoSpaceId: null,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
//this.handleQuery()
|
||||
this.cargoSpaceList = []
|
||||
this.total = 0
|
||||
this.loading = false
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.cargoSpaceId)
|
||||
this.selection = selection
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "新增货位"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const cargoSpaceId = row.cargoSpaceId || this.ids
|
||||
getCargoSpace(cargoSpaceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改货位"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 检查cargoSpaceId是否存在且不为空
|
||||
if (this.form.cargoSpaceId && this.form.cargoSpaceId.trim() !== '') {
|
||||
// 检查数据库中是否存在该ID的记录
|
||||
getCargoSpace(this.form.cargoSpaceId).then(response => {
|
||||
// 检查返回的数据是否为null或空对象
|
||||
if (response.data && response.data.cargoSpaceId) {
|
||||
// 如果能获取到有效数据,说明记录存在,调用修改方法
|
||||
updateCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
// 如果返回数据为空,说明记录不存在,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 如果请求失败,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 如果cargoSpaceId为空,直接调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const cargoSpaceIds = row.cargoSpaceId || this.ids
|
||||
this.$modal.confirm('确认要删除货位编号为 "' + cargoSpaceIds + '" 的货位吗?').then(function() {
|
||||
return delCargoSpace(cargoSpaceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 生成任务接口 */
|
||||
handleCargoSpaceOut(exitId) {
|
||||
if (!this.selection || this.selection.length === 0) {
|
||||
this.$modal.msgError("请至少选择一个货位");
|
||||
return;
|
||||
}
|
||||
|
||||
const promises = this.selection.map(row => {
|
||||
const params = {
|
||||
warehouseId: row.warehouseId,
|
||||
exitId: exitId,
|
||||
cargoSpaceId: row.cargoSpaceId
|
||||
};
|
||||
return cargoSpaceOut(params);
|
||||
});
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
this.$modal.msgSuccess("出库任务生成成功");
|
||||
this.getList();
|
||||
}).catch(err => {
|
||||
// 错误处理通常由拦截器完成,这里可以根据需要补充
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
labelWidthForSearch() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '84px' : '68px';
|
||||
},
|
||||
labelWidthForFunction() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '150px' : '120px';
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
409
ruoyi-ui/src/views/out/outJobFlow.vue
Normal file
409
ruoyi-ui/src/views/out/outJobFlow.vue
Normal file
@@ -0,0 +1,409 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="合同号" prop="contract">
|
||||
<el-input
|
||||
v-model="queryParams.contract"
|
||||
placeholder="请输入合同号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品号" prop="cases">
|
||||
<el-input
|
||||
v-model="queryParams.cases"
|
||||
placeholder="请输入产品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="代号" prop="managementNo">
|
||||
<el-input
|
||||
v-model="queryParams.managementNo"
|
||||
placeholder="请输入代号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="台次" prop="units">
|
||||
<el-input
|
||||
v-model="queryParams.units"
|
||||
placeholder="请输入台次"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入托盘条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始时间" prop="dateStart">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dateStart"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择起始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期" prop="dateEnd">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dateEnd"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCreateReturnStockIn"
|
||||
>生成退料入库单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ViewOutJobFlowList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="仓库编码" align="center" prop="warehouseId" />-->
|
||||
<el-table-column label="子任务" align="center" prop="jobDetailId" width="160"/>
|
||||
<el-table-column label="任务编码" align="center" prop="jobId" width="160"/>
|
||||
<el-table-column label="单据编码" align="center" prop="inOrOutId" width="160"/>
|
||||
<el-table-column label="子单据编码" align="center" prop="inOrOutDId" width="160" />
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_job_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务类型" align="center" prop="inOrOut" width="160">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.out_job_type" :value="scope.row.inOrOut"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" width="160"/>
|
||||
<el-table-column label="出口" align="center" prop="exitId">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.exit_type" :value="scope.row.exitId"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同号" align="center" prop="contract" />
|
||||
<el-table-column label="产品号" align="center" prop="cases" />
|
||||
<el-table-column label="代号" align="center" prop="managementNo" />
|
||||
<el-table-column label="台次" align="center" prop="units" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" width="160"/>
|
||||
<el-table-column label="规格" align="center" prop="spec" width="160"/>
|
||||
<el-table-column label="出库数量" align="center" prop="outQuantity" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="160"/>
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" width="160"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 退料入库单生成弹窗 -->
|
||||
<el-dialog title="生成退料入库单" :visible.sync="returnStockInOpen" width="1000px" append-to-body>
|
||||
<el-table :data="returnStockInList">
|
||||
<el-table-column label="合同号" align="center" prop="contract" />
|
||||
<el-table-column label="产品号" align="center" prop="cases" />
|
||||
<el-table-column label="代号" align="center" prop="managementNo" />
|
||||
<el-table-column label="台次" align="center" prop="units" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" />
|
||||
<el-table-column label="数量" align="center" prop="outQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.outQuantity" :min="1" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitReturnStockIn">提 交</el-button>
|
||||
<el-button @click="returnStockInOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addViewOutJobFlow,
|
||||
delViewOutJobFlow,
|
||||
getViewOutJobFlow,
|
||||
listViewOutJobFlow,
|
||||
updateViewOutJobFlow
|
||||
} from "@/api/search/ViewOutJobFlow"
|
||||
import { productBack } from "@/api/in/stockIn"
|
||||
|
||||
export default {
|
||||
name: "ViewOutJobFlow",
|
||||
dicts: ['product_type', 'turnover_type', 'exit_type', 'quality_type', 'purpose_type', 'sys_job_status', 'product_status', 'sys_yes_no', 'account_type', 'out_job_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 出库作业流水Controller表格数据
|
||||
ViewOutJobFlowList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 退料入库单弹窗控制
|
||||
returnStockInOpen: false,
|
||||
// 退料入库单表格数据
|
||||
returnStockInList: [],
|
||||
// 选中行原始数据
|
||||
selectedRows: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobDetailId: null,
|
||||
jobId: null,
|
||||
taskNo: null,
|
||||
status: null,
|
||||
inOrOut: null,
|
||||
trayCode: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
productType: null,
|
||||
systemItem: null,
|
||||
productCtm: null,
|
||||
productCtu: null,
|
||||
upperNum: null,
|
||||
limitNum: null,
|
||||
enableFlag: null,
|
||||
outQuantity: null,
|
||||
lotNo: null,
|
||||
inOrOutId: null,
|
||||
inOrOutDId: null,
|
||||
priceTotal: null,
|
||||
origin: null,
|
||||
turnovertype: null,
|
||||
account: null,
|
||||
purpose: null,
|
||||
units: null,
|
||||
contract: null,
|
||||
cases: null,
|
||||
quality: null,
|
||||
managementNo: null,
|
||||
dateStart: null,
|
||||
dateEnd: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
taskNo: [
|
||||
{ required: true, message: "任务号不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询出库作业流水Controller列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listViewOutJobFlow(this.queryParams).then(response => {
|
||||
this.ViewOutJobFlowList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
jobDetailId: null,
|
||||
jobId: null,
|
||||
taskNo: null,
|
||||
status: null,
|
||||
inOrOut: null,
|
||||
trayCode: null,
|
||||
createTime: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
remark: null,
|
||||
productType: null,
|
||||
systemItem: null,
|
||||
productCtm: null,
|
||||
productCtu: null,
|
||||
upperNum: null,
|
||||
limitNum: null,
|
||||
enableFlag: null,
|
||||
outQuantity: null,
|
||||
lotNo: null,
|
||||
inOrOutId: null,
|
||||
inOrOutDId: null,
|
||||
priceTotal: null,
|
||||
origin: null,
|
||||
turnovertype: null,
|
||||
account: null,
|
||||
purpose: null,
|
||||
units: null,
|
||||
contract: null,
|
||||
cases: null,
|
||||
quality: null,
|
||||
managementNo: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.jobDetailId)
|
||||
this.selectedRows = selection
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加出库作业流水Controller"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const jobDetailId = row.jobDetailId || this.ids
|
||||
getViewOutJobFlow(jobDetailId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改出库作业流水Controller"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.jobDetailId != null) {
|
||||
updateViewOutJobFlow(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addViewOutJobFlow(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const jobDetailIds = row.jobDetailId || this.ids
|
||||
this.$modal.confirm('是否确认删除出库作业流水Controller编号为"' + jobDetailIds + '"的数据项?').then(function() {
|
||||
return delViewOutJobFlow(jobDetailIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('search/ViewOutJobFlow/export', {
|
||||
...this.queryParams
|
||||
}, `ViewOutJobFlow_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 生成退料入库单按钮操作 */
|
||||
handleCreateReturnStockIn() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$modal.msgWarning("请选择要生成退料入库单的数据");
|
||||
return;
|
||||
}
|
||||
// 深拷贝选中的数据到弹窗列表
|
||||
this.returnStockInList = JSON.parse(JSON.stringify(this.selectedRows));
|
||||
this.returnStockInOpen = true;
|
||||
},
|
||||
/** 提交退料入库单 */
|
||||
submitReturnStockIn() {
|
||||
if (this.returnStockInList.length === 0) {
|
||||
return;
|
||||
}
|
||||
productBack(this.returnStockInList).then(response => {
|
||||
this.$modal.msgSuccess("生成成功");
|
||||
this.returnStockInOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,64 +1,40 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="库存编码" prop="stockId"><!-- 库存id -->
|
||||
<el-input
|
||||
v-model="queryParams.stockId"
|
||||
placeholder="请输入库存编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排" prop="thePlatoon">
|
||||
<el-input
|
||||
v-model="queryParams.thePlatoon"
|
||||
placeholder="请输入排"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列" prop="theColumn">
|
||||
<el-input
|
||||
v-model="queryParams.theColumn"
|
||||
placeholder="请输入列"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="层" prop="theFloor">
|
||||
<el-input
|
||||
v-model="queryParams.theFloor"
|
||||
placeholder="请输入层"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位名称" prop="cargoSpaceName"><!-- 货位id -->
|
||||
<el-input
|
||||
v-model="queryParams.cargoSpaceName"
|
||||
placeholder="请输入货位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderId"><!-- 货位id -->
|
||||
|
||||
<el-form-item label="合同号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单号"
|
||||
placeholder="请输入合同号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="托盘条码" prop="trayCode"><!-- 物料描述 -->
|
||||
<el-form-item label="产品号" prop="power">
|
||||
<el-input
|
||||
v-model="queryParams.power"
|
||||
placeholder="请输入产品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="代号" prop="distribution">
|
||||
<el-input
|
||||
v-model="queryParams.distribution"
|
||||
placeholder="请输入代号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="台次" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入台次"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入托盘条码"
|
||||
@@ -163,37 +139,6 @@
|
||||
<el-table-column label="重量" align="center" prop="theType" />
|
||||
<el-table-column label="容量" align="center" prop="theTypeName" />
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" width="80" />
|
||||
<!-- <el-table-column label="来源" align="center" prop="spare1" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="套账" align="center" prop="spare3" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用途" align="center" prop="spare4" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="入库单价" align="center" prop="spare6" />-->
|
||||
<!-- <el-table-column label="状态" align="center" prop="voltage" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.turnover_type" :value="scope.row.voltage"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="供应商" align="center" prop="inClassId" />-->
|
||||
<!-- <el-table-column label="产品质量" align="center" prop="spare8" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
||||
Reference in New Issue
Block a user