退货流程 出库异常流程 平库盘点流程
This commit is contained in:
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 盘点差异对象 check_difference_record
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@@ -66,132 +66,142 @@ public class CheckDifferenceRecord extends BaseEntity
|
||||
@Excel(name = "物料guid")
|
||||
private String productGuid;
|
||||
|
||||
public void setCheckGuid(String checkGuid)
|
||||
private String status;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setCheckGuid(String checkGuid)
|
||||
{
|
||||
this.checkGuid = checkGuid;
|
||||
}
|
||||
|
||||
public String getCheckGuid()
|
||||
public String getCheckGuid()
|
||||
{
|
||||
return checkGuid;
|
||||
}
|
||||
|
||||
public void setCheckStockDetailId(String checkStockDetailId)
|
||||
public void setCheckStockDetailId(String checkStockDetailId)
|
||||
{
|
||||
this.checkStockDetailId = checkStockDetailId;
|
||||
}
|
||||
|
||||
public String getCheckStockDetailId()
|
||||
public String getCheckStockDetailId()
|
||||
{
|
||||
return checkStockDetailId;
|
||||
}
|
||||
|
||||
public void setStockId(String stockId)
|
||||
public void setStockId(String stockId)
|
||||
{
|
||||
this.stockId = stockId;
|
||||
}
|
||||
|
||||
public String getStockId()
|
||||
public String getStockId()
|
||||
{
|
||||
return stockId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
{
|
||||
this.cargoSpaceId = cargoSpaceId;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId()
|
||||
public String getCargoSpaceId()
|
||||
{
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo)
|
||||
public void setLotNo(String lotNo)
|
||||
{
|
||||
this.lotNo = lotNo;
|
||||
}
|
||||
|
||||
public String getLotNo()
|
||||
public String getLotNo()
|
||||
{
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier)
|
||||
public void setSupplier(String supplier)
|
||||
{
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getSupplier()
|
||||
public String getSupplier()
|
||||
{
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setCustomer(String customer)
|
||||
public void setCustomer(String customer)
|
||||
{
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public String getCustomer()
|
||||
public String getCustomer()
|
||||
{
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setOldQuantity(String oldQuantity)
|
||||
public void setOldQuantity(String oldQuantity)
|
||||
{
|
||||
this.oldQuantity = oldQuantity;
|
||||
}
|
||||
|
||||
public String getOldQuantity()
|
||||
public String getOldQuantity()
|
||||
{
|
||||
return oldQuantity;
|
||||
}
|
||||
|
||||
public void setNewQuantity(String newQuantity)
|
||||
public void setNewQuantity(String newQuantity)
|
||||
{
|
||||
this.newQuantity = newQuantity;
|
||||
}
|
||||
|
||||
public String getNewQuantity()
|
||||
public String getNewQuantity()
|
||||
{
|
||||
return newQuantity;
|
||||
}
|
||||
|
||||
public void setRecordType(Long recordType)
|
||||
public void setRecordType(Long recordType)
|
||||
{
|
||||
this.recordType = recordType;
|
||||
}
|
||||
|
||||
public Long getRecordType()
|
||||
public Long getRecordType()
|
||||
{
|
||||
return recordType;
|
||||
}
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
|
||||
public String getProductGuid()
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.ruoyi.check.difference.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.check.difference.mapper.CheckDifferenceRecordMapper;
|
||||
@@ -10,19 +14,22 @@ import com.ruoyi.check.difference.service.ICheckDifferenceRecordService;
|
||||
|
||||
/**
|
||||
* 盘点差异Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordService
|
||||
public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordService
|
||||
{
|
||||
@Autowired
|
||||
private CheckDifferenceRecordMapper checkDifferenceRecordMapper;
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 盘点差异
|
||||
*/
|
||||
@@ -34,7 +41,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 查询盘点差异列表
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 盘点差异
|
||||
*/
|
||||
@@ -46,20 +53,31 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 新增盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCheckDifferenceRecord(CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
if (checkDifferenceRecord.getRecordType()==1){
|
||||
String stockId = checkDifferenceRecord.getStockId();
|
||||
BasStock basStock = basStockService.selectBasStockByStockId(stockId);
|
||||
checkDifferenceRecord.setOldQuantity(basStock.getQuantity());
|
||||
}else if (checkDifferenceRecord.getRecordType()==2){
|
||||
checkDifferenceRecord.setOldQuantity("0");
|
||||
}else if (checkDifferenceRecord.getRecordType()==3){
|
||||
checkDifferenceRecord.setNewQuantity("0");
|
||||
}
|
||||
checkDifferenceRecord.setCreateTime(DateUtils.getNowDate());
|
||||
checkDifferenceRecord.setCheckGuid(IdUtil.fastSimpleUUID());
|
||||
checkDifferenceRecord.setStatus("0");
|
||||
return checkDifferenceRecordMapper.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -71,7 +89,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuids 需要删除的盘点差异主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -83,7 +101,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 删除盘点差异信息
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.check.flat;
|
||||
|
||||
import com.ruoyi.check.difference.domain.CheckDifferenceRecord;
|
||||
import com.ruoyi.check.difference.service.ICheckDifferenceRecordService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 平库盘点
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/check/flatStockCheck")
|
||||
public class FlatStockCheckController {
|
||||
|
||||
@Autowired
|
||||
private ICheckDifferenceRecordService checkDifferenceRecordService;
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody CheckDifferenceRecord checkDifferenceRecord) {
|
||||
int i = checkDifferenceRecordService.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
return i > 0 ? AjaxResult.success(): AjaxResult.error();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -183,16 +183,17 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
if (job == null) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
if (job.getInOrOut().equals("5")){
|
||||
if ("5".equals(job.getInOrOut())){
|
||||
//料箱盘点入库作业
|
||||
|
||||
//修改货位
|
||||
BasCargoSpace basCargoSpace = new BasCargoSpace();
|
||||
basCargoSpace.setStatus("5");
|
||||
basCargoSpace.setStatus("7");
|
||||
basCargoSpace.setTrayCode(job.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(job.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
//插入历史表
|
||||
insertHistory(mydoJob.getJobId());
|
||||
return AjaxResult.success();
|
||||
|
||||
}else {
|
||||
|
||||
@@ -161,10 +161,12 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
outStockoutDetail.setStockoutId(stockoutId);
|
||||
List<OutStockoutDetail> outStockoutDetails = outStockoutDetailService.selectOutStockoutDetailList(outStockoutDetail);
|
||||
for (OutStockoutDetail detail : outStockoutDetails) {
|
||||
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
|
||||
outStockoutMapper.autoAllot(map);
|
||||
if (!"10".equals(map.get("v_result"))){
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
if (detail.getAllotQuantity().compareTo(detail.getQuantity()) < 0){
|
||||
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
|
||||
outStockoutMapper.autoAllot(map);
|
||||
if (!"10".equals(map.get("v_result"))){
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stringBuilder.length()>0){
|
||||
|
||||
@@ -244,6 +244,19 @@ public class PdaController extends BaseController {
|
||||
return pdaService.outMakeSure(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出货异常流程
|
||||
* @param trayCodeMakeSure
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:out:exception')")
|
||||
@PostMapping("/outException")
|
||||
@ResponseBody
|
||||
public AjaxResult outException(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.outException(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盘点出库确认
|
||||
* @param trayCodeMakeSure 托盘信息
|
||||
|
||||
@@ -26,4 +26,6 @@ public interface PdaService {
|
||||
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult outException(TrayCodeMakeSure trayCodeMakeSure);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||
import com.ruoyi.out.outStockout.service.IOutStockoutService;
|
||||
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.out.outStockoutDetail.service.IOutStockoutDetailService;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import com.ruoyi.pda.mapper.PdaMapper;
|
||||
@@ -34,6 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PdaServiceImp implements PdaService {
|
||||
@@ -58,6 +63,10 @@ public class PdaServiceImp implements PdaService {
|
||||
private IBasContainerDetailsService basContainerDetailsService;
|
||||
@Autowired
|
||||
private ICheckCommitRecordService checkCommitRecordService;
|
||||
@Autowired
|
||||
private IOutStockoutService outStockoutService;
|
||||
@Autowired
|
||||
private IOutStockoutDetailService outStockoutDetailService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -188,35 +197,12 @@ public class PdaServiceImp implements PdaService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
//修改拣选数量
|
||||
|
||||
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
|
||||
if(CollUtil.isNotEmpty(mydoJobDetailList)){
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
|
||||
BasContainerDetails basContainerDetailsParam = new BasContainerDetails();
|
||||
basContainerDetailsParam.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
basContainerDetailsParam.setProductId(mydoJobDetailOld.getProductId());
|
||||
List<BasContainerDetails> basContainerDetails = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetailsParam);
|
||||
if (CollUtil.isNotEmpty(basContainerDetails)){
|
||||
BasContainerDetails oldBasContainerDetails = basContainerDetails.get(0);
|
||||
oldBasContainerDetails.setQuantity(oldBasContainerDetails.getQuantity()+Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.updateBasContainerDetails(oldBasContainerDetails);
|
||||
}else {
|
||||
BasContainerDetails newBasContainerDetails = new BasContainerDetails();
|
||||
newBasContainerDetails.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
newBasContainerDetails.setProductId(mydoJobDetail.getProductId());
|
||||
newBasContainerDetails.setQuantity(Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.insertBasContainerDetails(newBasContainerDetails);
|
||||
}
|
||||
}
|
||||
|
||||
if(CollUtil.isEmpty(mydoJobDetailList)){
|
||||
return AjaxResult.warn("拣选的物料不能为空");
|
||||
}
|
||||
//查询当前任务是否已经全部拣选完成
|
||||
//判断任务是否存在
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
List<MydoJob> mydoJobList = mydoJobService.selectMydoJobList(mydoJobParam);
|
||||
@@ -231,7 +217,106 @@ public class PdaServiceImp implements PdaService {
|
||||
return AjaxResult.warn("子任务不存在");
|
||||
}
|
||||
|
||||
boolean flag = mydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
//获取单据类型
|
||||
OutStockout outStockoutParam = new OutStockout();
|
||||
outStockoutParam.setStockoutId(mydoJobDetails.get(0).getInOrOutId());
|
||||
List<OutStockout> outStockouts = outStockoutService.selectOutStockoutList(outStockoutParam);
|
||||
if (CollUtil.isEmpty(outStockouts)) {
|
||||
return AjaxResult.warn("单据不存在");
|
||||
}
|
||||
String billType = outStockouts.get(0).getOutType();
|
||||
|
||||
switch (billType) {
|
||||
case "1":
|
||||
//销售单据
|
||||
return handleOutType1(trayCodeMakeSure,mydoJobDetailList,mydoJobList.get(0));
|
||||
case "2":
|
||||
//退货单据 不绑定容器
|
||||
return handleOutType2(trayCodeMakeSure,mydoJobDetailList,mydoJobList.get(0));
|
||||
default:
|
||||
return AjaxResult.warn("单据类型错误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理退货出库
|
||||
* @param trayCodeMakeSure
|
||||
* @param mydoJobDetailList
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
|
||||
private AjaxResult handleOutType2(TrayCodeMakeSure trayCodeMakeSure,List<MydoJobDetail> mydoJobDetailList,MydoJob mydoJob) {
|
||||
//修改拣选数量
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
}
|
||||
//判断拣选数量是否等于出库数量
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.warn("拣选完成");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理正常出库
|
||||
* @param trayCodeMakeSure
|
||||
* @param mydoJobDetailList
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
private AjaxResult handleOutType1(TrayCodeMakeSure trayCodeMakeSure,List<MydoJobDetail> mydoJobDetailList,MydoJob mydoJob) {
|
||||
|
||||
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
|
||||
//修改拣选数量
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
|
||||
//绑定容器
|
||||
BasContainerDetails basContainerDetailsParam = new BasContainerDetails();
|
||||
basContainerDetailsParam.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
basContainerDetailsParam.setProductId(mydoJobDetailOld.getProductId());
|
||||
List<BasContainerDetails> basContainerDetails = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetailsParam);
|
||||
if (CollUtil.isNotEmpty(basContainerDetails)){
|
||||
BasContainerDetails oldBasContainerDetails = basContainerDetails.get(0);
|
||||
oldBasContainerDetails.setQuantity(oldBasContainerDetails.getQuantity()+Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.updateBasContainerDetails(oldBasContainerDetails);
|
||||
}else {
|
||||
BasContainerDetails newBasContainerDetails = new BasContainerDetails();
|
||||
newBasContainerDetails.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
newBasContainerDetails.setProductId(mydoJobDetail.getProductId());
|
||||
newBasContainerDetails.setQuantity(Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.insertBasContainerDetails(newBasContainerDetails);
|
||||
}
|
||||
}
|
||||
|
||||
//判断拣选数量是否等于出库数量
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
@@ -276,4 +361,45 @@ public class PdaServiceImp implements PdaService {
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult outException(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
//判断任务是否存在
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
List<MydoJob> mydoJobList = mydoJobService.selectMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isEmpty(mydoJobList)) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
|
||||
//判断拣选数量
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
|
||||
String stockOutId = "";
|
||||
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
//修改单据实际分配数量
|
||||
BigDecimal pickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(mydoJobDetail.getInOrOutDId());
|
||||
outStockoutDetail.setAllotQuantity(outStockoutDetail.getAllotQuantity().subtract(pickQuantity));
|
||||
stockOutId = outStockoutDetail.getStockoutId();
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
//生成回流任务,返回原库位,标记货位为异常待盘点状态
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
//自动分配
|
||||
outStockoutService.autoAllot(stockOutId);
|
||||
return AjaxResult.success("操作成功");
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存信息对象 bas_stock
|
||||
*
|
||||
@@ -125,6 +127,16 @@ public class BasStock extends BaseEntity
|
||||
|
||||
private String productId;
|
||||
|
||||
private List<String> typeData;
|
||||
|
||||
public List<String> getTypeData() {
|
||||
return typeData;
|
||||
}
|
||||
|
||||
public void setTypeData(List<String> typeData) {
|
||||
this.typeData = typeData;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.check.difference.mapper.CheckDifferenceRecordMapper">
|
||||
|
||||
|
||||
<resultMap type="CheckDifferenceRecord" id="CheckDifferenceRecordResult">
|
||||
<result property="checkGuid" column="check_guid" />
|
||||
<result property="checkStockDetailId" column="check_stock_detail_id" />
|
||||
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult">
|
||||
<include refid="selectCheckDifferenceRecordVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="checkStockDetailId != null and checkStockDetailId != ''"> and check_stock_detail_id = #{checkStockDetailId}</if>
|
||||
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCheckDifferenceRecordByCheckGuid" parameterType="String" resultMap="CheckDifferenceRecordResult">
|
||||
<include refid="selectCheckDifferenceRecordVo"/>
|
||||
where check_guid = #{checkGuid}
|
||||
@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null">record_type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="checkGuid != null">#{checkGuid},</if>
|
||||
@@ -81,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null">#{recordType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -109,9 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCheckDifferenceRecordByCheckGuids" parameterType="String">
|
||||
delete from check_difference_record where check_guid in
|
||||
delete from check_difference_record where check_guid in
|
||||
<foreach item="checkGuid" collection="array" open="(" separator="," close=")">
|
||||
#{checkGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -87,6 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare5 != null and spare5 != ''"> and bs.spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and bs.spare6 = #{spare6}</if>
|
||||
<if test="cargoSpaceStockStatus != null and cargoSpaceStockStatus != ''"> and bcs.status = #{cargoSpaceStockStatus}</if>
|
||||
<if test="typeData != null and typeData.size()>0">
|
||||
and bw.warehouse_type in
|
||||
<foreach item="item" index="index" collection="typeData" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
586
ruoyi-ui/src/views/check/flat/index.vue
Normal file
586
ruoyi-ui/src/views/check/flat/index.vue
Normal file
@@ -0,0 +1,586 @@
|
||||
<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="$t('stockManagement.stockId')" prop="stockId"><!-- 库存id -->
|
||||
<el-input
|
||||
v-model="queryParams.stockId"
|
||||
:placeholder="$t('stockManagement.inputStockId')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.cargoSpaceId')" prop="cargoSpaceId"><!-- 货位id -->
|
||||
<el-input
|
||||
v-model="queryParams.cargoSpaceId"
|
||||
:placeholder="$t('stockManagement.inputCargoSpaceId')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.stockStatus')" prop="cargoSpaceStockStatus"><!-- 库存状态 -->
|
||||
<el-select v-model="queryParams.cargoSpaceStockStatus" :placeholder="$t('stockManagement.selectStockStatus')"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.productStatus')" prop="productStatus"><!-- 物料状态 -->
|
||||
<el-select v-model="queryParams.productStatus" :placeholder="$t('stockManagement.selectProductStatus')"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.product_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.lotNo')" prop="lotNo"><!-- 批次号 -->
|
||||
<el-input
|
||||
v-model="queryParams.lotNo"
|
||||
:placeholder="$t('stockManagement.inputLotNo')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.inDate')" prop="inDate"><!-- 入库时间 -->
|
||||
<el-input
|
||||
v-model="queryParams.inDate"
|
||||
:placeholder="$t('stockManagement.inputInDate')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="回流时间" prop="backDate">
|
||||
<el-input
|
||||
v-model="queryParams.backDate"
|
||||
placeholder="请输入回流时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料GUID" prop="productGuid">
|
||||
<el-input
|
||||
v-model="queryParams.productGuid"
|
||||
placeholder="请输入物料GUID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" prop="quantity">
|
||||
<el-input
|
||||
v-model="queryParams.quantity"
|
||||
placeholder="请输入库存数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="作业ID" prop="jobId">
|
||||
<el-input
|
||||
v-model="queryParams.jobId"
|
||||
placeholder="请输入作业ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item :label="$t('stockManagement.trayCode')" prop="trayCode"><!-- 托盘条码 -->
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
:placeholder="$t('stockManagement.inputTrayCode')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('stockManagement.materialDesc')" prop="productName"><!-- 物料描述 -->
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
:placeholder="$t('stockManagement.materialDesc')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="出库数量" prop="outQuantity">
|
||||
<el-input
|
||||
v-model="queryParams.outQuantity"
|
||||
placeholder="请输入出库数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单id" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinDetailId"
|
||||
placeholder="请输入入库子单id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库主单" prop="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入入库主单"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库班组ID" prop="inClassId">
|
||||
<el-input
|
||||
v-model="queryParams.inClassId"
|
||||
placeholder="请输入入库班组ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item :label="$t('stockManagement.warehouseId')" prop="warehouseId"><!-- 仓库id -->
|
||||
<el-select v-model="queryParams.warehouseId" :placeholder="$t('stockManagement.warehouseId')">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入备用字段1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="请输入备用字段2"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="请输入备用字段3"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入备用字段4"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入备用字段5"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段6" prop="spare6">
|
||||
<el-input
|
||||
v-model="queryParams.spare6"
|
||||
placeholder="请输入备用字段6"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
|
||||
{{ $t('stockManagement.search') }}
|
||||
</el-button><!-- 搜索 -->
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('stockManagement.reset') }}</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"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['stock:management:add']"
|
||||
>{{ $t('stockManagement.add') }} <!-- 新增 --></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>{{ $t('stockManagement.edit') }} <!-- 修改 --></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>{{ $t('stockManagement.delete') }} <!-- 删除 --></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['stock:management:export']"
|
||||
>{{ $t('stockManagement.export') }} <!-- 导出 --></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="managementList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column :label="$t('stockManagement.stockId')" align="center" prop="stockId"/> <!-- 库存id -->
|
||||
<el-table-column :label="$t('stockManagement.cargoSpaceId')" align="center" prop="cargoSpaceId"/> <!-- 货位id -->
|
||||
<el-table-column :label="$t('stockManagement.cargoSpaceName')" align="center" prop="cargoSpaceName"/>
|
||||
<!-- 货位id -->
|
||||
<el-table-column :label="$t('stockManagement.stockStatus')" align="center" prop="cargoSpaceStockStatus">
|
||||
<!-- 库存状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_status" :value="scope.row.cargoSpaceStockStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('stockManagement.cargoSpaceStatus')" align="center" prop="cargoSpaceStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.cargoSpaceStatus"/>
|
||||
</template>
|
||||
</el-table-column><!-- 货位状态 -->
|
||||
<el-table-column :label="$t('stockManagement.productStatus')" align="center" prop="productStatus"> <!-- 物料状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.product_status" :value="scope.row.productStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('stockManagement.lotNo')" align="center" prop="lotNo"/> <!-- 批次号 -->
|
||||
<!-- <el-table-column :label="$t('stockManagement.backDate')" align="center" prop="backDate" /> <!– 回流时间 –>-->
|
||||
<el-table-column :label="$t('stockManagement.productId')" align="center" prop="extraField.productId"/>
|
||||
<!-- 物料Id -->
|
||||
<el-table-column :label="$t('stockManagement.materialDesc')" align="center" prop="extraField.materialDesc"/>
|
||||
<!-- 物料描述 -->
|
||||
<el-table-column :label="$t('stockManagement.englishDesc')" align="center" prop="extraField.englishDesc"/>
|
||||
<!-- 物料英文描述 -->
|
||||
<el-table-column :label="$t('stockManagement.netWeight')" align="center" prop="extraField.netWeight"/> <!-- 净重 -->
|
||||
<el-table-column :label="$t('stockManagement.length')" align="center" prop="extraField.length"/> <!-- 长 -->
|
||||
<el-table-column :label="$t('stockManagement.width')" align="center" prop="extraField.width"/> <!-- 宽 -->
|
||||
<el-table-column :label="$t('stockManagement.height')" align="center" prop="extraField.height"/> <!-- 高 -->
|
||||
<el-table-column :label="$t('stockManagement.volume')" align="center" prop="extraField.volume"/> <!-- 体积 -->
|
||||
<el-table-column :label="$t('stockManagement.quantity')" align="center" prop="quantity"/> <!-- 库存数量 -->
|
||||
<el-table-column :label="$t('stockManagement.jobId')" align="center" prop="jobId"/> <!-- 作业ID -->
|
||||
<el-table-column :label="$t('stockManagement.trayCode')" align="center" prop="trayCode"/> <!-- 托盘条码 -->
|
||||
<!-- <el-table-column :label="$t('stockManagement.outQuantity')" align="center" prop="outQuantity" /> <!– 出库数量 –>-->
|
||||
<el-table-column :label="$t('stockManagement.stockinId')" align="center" prop="stockinId"/> <!-- 入库主单 -->
|
||||
<el-table-column :label="$t('stockManagement.stockinDetailId')" align="center" prop="stockinDetailId"/>
|
||||
<!-- 入库子单id -->
|
||||
<el-table-column :label="$t('stockManagement.inType')" align="center" prop="inType"/> <!-- 入库类型 -->
|
||||
<!-- <el-table-column :label="$t('stockManagement.inClassId')" align="center" prop="inClassId" /> <!– 入库班组ID –>-->
|
||||
<el-table-column :label="$t('stockManagement.warehouseId')" align="center" prop="warehouseName"/> <!-- 仓库 -->
|
||||
<el-table-column :label="$t('stockManagement.inDate')" align="center" prop="inDate"/> <!-- 入库时间 -->
|
||||
<!-- <el-table-column :label="$t('stockManagement.stackingId')" align="center" prop="stackingId" /> <!– 垛型ID –>-->
|
||||
<el-table-column :label="$t('stockManagement.operation')" align="center" class-name="small-padding fixed-width">
|
||||
<!-- 操作 -->
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>{{ $t('stockManagement.edit') }} <!-- 修改 --></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>{{ $t('stockManagement.delete') }} <!-- 删除 --></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改库存信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item :label="$t('stockManagement.stockId')" prop="stockId"> <!-- 库存id -->
|
||||
<el-input v-model="form.stockId" :placeholder="$t('stockManagement.inputStockId')"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.cargoSpaceId')" prop="cargoSpaceId"> <!-- 货位id -->
|
||||
<el-input v-model="form.cargoSpaceId" :placeholder="$t('stockManagement.inputCargoSpaceId')"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.productId')" prop="extraField.productId"> <!-- 物料ID -->
|
||||
<el-input v-model="form.productId" :placeholder="$t('stockManagement.inputProductId')"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('stockManagement.quantity')" prop="quantity"> <!-- 库存数量 -->
|
||||
<el-input v-model="form.quantity" :placeholder="$t('stockManagement.inputQuantity')"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">{{ $t('stockManagement.confirm') }} <!-- 确定 --></el-button>
|
||||
<el-button @click="cancel">{{ $t('stockManagement.cancel') }} <!-- 取消 --></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listManagement, getManagement} from "@/api/stock/management"
|
||||
import {listWarehouse} from "@/api/bas/warehouse"
|
||||
import {addDifference} from "@/api/check/difference";
|
||||
|
||||
export default {
|
||||
name: "Management",
|
||||
dicts: ['product_status', 'stock_status', 'cargo_space_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 库存信息表格数据
|
||||
managementList: [],
|
||||
// 仓库选项
|
||||
warehouseOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
//点击的按钮
|
||||
type: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockId: null,
|
||||
cargoSpaceId: null,
|
||||
stockStatus: null,
|
||||
productStatus: null,
|
||||
lotNo: null,
|
||||
inDate: null,
|
||||
backDate: null,
|
||||
productGuid: null,
|
||||
quantity: null,
|
||||
jobId: null,
|
||||
trayCode: null,
|
||||
outQuantity: null,
|
||||
stockinDetailId: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
inClassId: null,
|
||||
warehouseId: null,
|
||||
stackingId: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
typeData: ["3"]
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
/*stockId: [
|
||||
{ required: true, message: this.$t('stockManagement.stockIdRequired'), trigger: "blur" } // 库存id不能为空
|
||||
]*/
|
||||
},
|
||||
pdData:{}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWarehouseList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
var data = {
|
||||
"typeData": ["3"]
|
||||
}
|
||||
listWarehouse(data).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询库存信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listManagement(this.queryParams).then(response => {
|
||||
this.managementList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockId: null,
|
||||
cargoSpaceId: null,
|
||||
stockStatus: null,
|
||||
productStatus: null,
|
||||
lotNo: null,
|
||||
inDate: null,
|
||||
backDate: null,
|
||||
productGuid: null,
|
||||
quantity: null,
|
||||
jobId: null,
|
||||
trayCode: null,
|
||||
outQuantity: null,
|
||||
stockinDetailId: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
inClassId: null,
|
||||
warehouseId: null,
|
||||
stackingId: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
type: ""
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = this.$t('stockManagement.addTitle') // 添加库存信息
|
||||
this.form.type = "2"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockId = row.stockId || this.ids
|
||||
getManagement(stockId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = this.$t('stockManagement.editTitle') // 修改库存信息
|
||||
this.form.type = "1"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (this.form.type === "1") {
|
||||
this.pdData={}
|
||||
//修改
|
||||
this.pdData= {
|
||||
stockId: this.form.stockId,
|
||||
trayCode: this.form.trayCode,
|
||||
newQuantity: this.form.quantity,
|
||||
cargoSpaceId: this.form.cargoSpaceId,
|
||||
warehouseId: this.form.warehouseId,
|
||||
productId: this.form.productId,
|
||||
recordType: 1
|
||||
}
|
||||
addDifference(this.pdData).then(response => {
|
||||
this.$modal.msgSuccess(this.$t('stockManagement.editSuccess'))
|
||||
this.open = false
|
||||
this.getList()
|
||||
});
|
||||
} else if (this.form.type === "2") {
|
||||
this.pdData={}
|
||||
//新增
|
||||
this.pdData= {
|
||||
trayCode: this.form.trayCode,
|
||||
newQuantity: this.form.quantity,
|
||||
cargoSpaceId: this.form.cargoSpaceId,
|
||||
warehouseId: this.form.warehouseId,
|
||||
productId: this.form.productId,
|
||||
recordType: 2
|
||||
}
|
||||
addDifference(this.pdData).then(response => {
|
||||
this.$modal.msgSuccess(this.$t('stockManagement.addSuccess'))
|
||||
this.open = false
|
||||
this.getList()
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockIds = row.stockId || this.ids
|
||||
//删除
|
||||
this.pdData={}
|
||||
this.pdData={
|
||||
trayCode: this.form.trayCode,
|
||||
oldQuantity: this.form.quantity,
|
||||
cargoSpaceId: this.form.cargoSpaceId,
|
||||
warehouseId: this.form.warehouseId,
|
||||
productId: this.form.productId,
|
||||
recordType: 3
|
||||
}
|
||||
addDifference(this.pdData).then(response => {
|
||||
this.$modal.msgSuccess(this.$t('stockManagement.deleteSuccess'))
|
||||
this.getList()
|
||||
this.reset()
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('stock/management/export', {
|
||||
...this.queryParams
|
||||
}, `management_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user