pda盘点确认

This commit is contained in:
liuhanqing
2025-06-19 17:47:52 +08:00
parent b9fc02c01b
commit afb022d365
29 changed files with 1022 additions and 100 deletions

View File

@@ -26,6 +26,7 @@ public class BasCargoSpace {
/** 仓库id(不允许为空) */
@Excel(name = "仓库id", readConverterExp = "不=允许为空")
private String warehouseId;
private String warehouseName;
/** 巷道id(允许为空) */
@Excel(name = "巷道id", readConverterExp = "允=许为空")

View File

@@ -0,0 +1,104 @@
package com.ruoyi.check.commit.controller;
import java.util.List;
import javax.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.check.commit.domain.CheckCommitRecord;
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 盘点数据信息Controller
*
* @author ruoyi
* @date 2025-06-19
*/
@RestController
@RequestMapping("/check/commit")
public class CheckCommitRecordController extends BaseController
{
@Autowired
private ICheckCommitRecordService checkCommitRecordService;
/**
* 查询盘点数据信息列表
*/
@PreAuthorize("@ss.hasPermi('check:commit:list')")
@GetMapping("/list")
public TableDataInfo list(CheckCommitRecord checkCommitRecord)
{
startPage();
List<CheckCommitRecord> list = checkCommitRecordService.selectCheckCommitRecordList(checkCommitRecord);
return getDataTable(list);
}
/**
* 导出盘点数据信息列表
*/
@PreAuthorize("@ss.hasPermi('check:commit:export')")
@Log(title = "盘点数据信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CheckCommitRecord checkCommitRecord)
{
List<CheckCommitRecord> list = checkCommitRecordService.selectCheckCommitRecordList(checkCommitRecord);
ExcelUtil<CheckCommitRecord> util = new ExcelUtil<CheckCommitRecord>(CheckCommitRecord.class);
util.exportExcel(response, list, "盘点数据信息数据");
}
/**
* 获取盘点数据信息详细信息
*/
@PreAuthorize("@ss.hasPermi('check:commit:query')")
@GetMapping(value = "/{pdGuid}")
public AjaxResult getInfo(@PathVariable("pdGuid") Long pdGuid)
{
return success(checkCommitRecordService.selectCheckCommitRecordByPdGuid(pdGuid));
}
/**
* 新增盘点数据信息
*/
@PreAuthorize("@ss.hasPermi('check:commit:add')")
@Log(title = "盘点数据信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CheckCommitRecord checkCommitRecord)
{
return toAjax(checkCommitRecordService.insertCheckCommitRecord(checkCommitRecord));
}
/**
* 修改盘点数据信息
*/
@PreAuthorize("@ss.hasPermi('check:commit:edit')")
@Log(title = "盘点数据信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CheckCommitRecord checkCommitRecord)
{
return toAjax(checkCommitRecordService.updateCheckCommitRecord(checkCommitRecord));
}
/**
* 删除盘点数据信息
*/
@PreAuthorize("@ss.hasPermi('check:commit:remove')")
@Log(title = "盘点数据信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{pdGuids}")
public AjaxResult remove(@PathVariable Long[] pdGuids)
{
return toAjax(checkCommitRecordService.deleteCheckCommitRecordByPdGuids(pdGuids));
}
}

View File

@@ -0,0 +1,128 @@
package com.ruoyi.check.commit.domain;
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;
/**
* 盘点数据信息对象 check_commit_record
*
* @author ruoyi
* @date 2025-06-19
*/
public class CheckCommitRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 盘点id */
@Excel(name = "盘点id")
private Long pdGuid;
/** 托盘码 */
@Excel(name = "托盘码")
private String trayCode;
/** 库存id */
@Excel(name = "库存id")
private String stockId;
/** 盘点数量 */
@Excel(name = "盘点数量")
private String quantity;
/** 备用1 */
@Excel(name = "备用1")
private String spare1;
/** 备用2 */
@Excel(name = "备用2")
private String spare2;
/** 备用3 */
@Excel(name = "备用3")
private String spare3;
public void setPdGuid(Long pdGuid)
{
this.pdGuid = pdGuid;
}
public Long getPdGuid()
{
return pdGuid;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setStockId(String stockId)
{
this.stockId = stockId;
}
public String getStockId()
{
return stockId;
}
public void setQuantity(String quantity)
{
this.quantity = quantity;
}
public String getQuantity()
{
return quantity;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("pdGuid", getPdGuid())
.append("trayCode", getTrayCode())
.append("stockId", getStockId())
.append("quantity", getQuantity())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.check.commit.mapper;
import java.util.List;
import com.ruoyi.check.commit.domain.CheckCommitRecord;
/**
* 盘点数据信息Mapper接口
*
* @author ruoyi
* @date 2025-06-19
*/
public interface CheckCommitRecordMapper
{
/**
* 查询盘点数据信息
*
* @param pdGuid 盘点数据信息主键
* @return 盘点数据信息
*/
public CheckCommitRecord selectCheckCommitRecordByPdGuid(Long pdGuid);
/**
* 查询盘点数据信息列表
*
* @param checkCommitRecord 盘点数据信息
* @return 盘点数据信息集合
*/
public List<CheckCommitRecord> selectCheckCommitRecordList(CheckCommitRecord checkCommitRecord);
/**
* 新增盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
public int insertCheckCommitRecord(CheckCommitRecord checkCommitRecord);
/**
* 修改盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
public int updateCheckCommitRecord(CheckCommitRecord checkCommitRecord);
/**
* 删除盘点数据信息
*
* @param pdGuid 盘点数据信息主键
* @return 结果
*/
public int deleteCheckCommitRecordByPdGuid(Long pdGuid);
/**
* 批量删除盘点数据信息
*
* @param pdGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCheckCommitRecordByPdGuids(Long[] pdGuids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.check.commit.service;
import java.util.List;
import com.ruoyi.check.commit.domain.CheckCommitRecord;
/**
* 盘点数据信息Service接口
*
* @author ruoyi
* @date 2025-06-19
*/
public interface ICheckCommitRecordService
{
/**
* 查询盘点数据信息
*
* @param pdGuid 盘点数据信息主键
* @return 盘点数据信息
*/
public CheckCommitRecord selectCheckCommitRecordByPdGuid(Long pdGuid);
/**
* 查询盘点数据信息列表
*
* @param checkCommitRecord 盘点数据信息
* @return 盘点数据信息集合
*/
public List<CheckCommitRecord> selectCheckCommitRecordList(CheckCommitRecord checkCommitRecord);
/**
* 新增盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
public int insertCheckCommitRecord(CheckCommitRecord checkCommitRecord);
/**
* 修改盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
public int updateCheckCommitRecord(CheckCommitRecord checkCommitRecord);
/**
* 批量删除盘点数据信息
*
* @param pdGuids 需要删除的盘点数据信息主键集合
* @return 结果
*/
public int deleteCheckCommitRecordByPdGuids(Long[] pdGuids);
/**
* 删除盘点数据信息信息
*
* @param pdGuid 盘点数据信息主键
* @return 结果
*/
public int deleteCheckCommitRecordByPdGuid(Long pdGuid);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.check.commit.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.check.commit.mapper.CheckCommitRecordMapper;
import com.ruoyi.check.commit.domain.CheckCommitRecord;
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
/**
* 盘点数据信息Service业务层处理
*
* @author ruoyi
* @date 2025-06-19
*/
@Service
public class CheckCommitRecordServiceImpl implements ICheckCommitRecordService
{
@Autowired
private CheckCommitRecordMapper checkCommitRecordMapper;
/**
* 查询盘点数据信息
*
* @param pdGuid 盘点数据信息主键
* @return 盘点数据信息
*/
@Override
public CheckCommitRecord selectCheckCommitRecordByPdGuid(Long pdGuid)
{
return checkCommitRecordMapper.selectCheckCommitRecordByPdGuid(pdGuid);
}
/**
* 查询盘点数据信息列表
*
* @param checkCommitRecord 盘点数据信息
* @return 盘点数据信息
*/
@Override
public List<CheckCommitRecord> selectCheckCommitRecordList(CheckCommitRecord checkCommitRecord)
{
return checkCommitRecordMapper.selectCheckCommitRecordList(checkCommitRecord);
}
/**
* 新增盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
@Override
public int insertCheckCommitRecord(CheckCommitRecord checkCommitRecord)
{
return checkCommitRecordMapper.insertCheckCommitRecord(checkCommitRecord);
}
/**
* 修改盘点数据信息
*
* @param checkCommitRecord 盘点数据信息
* @return 结果
*/
@Override
public int updateCheckCommitRecord(CheckCommitRecord checkCommitRecord)
{
return checkCommitRecordMapper.updateCheckCommitRecord(checkCommitRecord);
}
/**
* 批量删除盘点数据信息
*
* @param pdGuids 需要删除的盘点数据信息主键
* @return 结果
*/
@Override
public int deleteCheckCommitRecordByPdGuids(Long[] pdGuids)
{
return checkCommitRecordMapper.deleteCheckCommitRecordByPdGuids(pdGuids);
}
/**
* 删除盘点数据信息信息
*
* @param pdGuid 盘点数据信息主键
* @return 结果
*/
@Override
public int deleteCheckCommitRecordByPdGuid(Long pdGuid)
{
return checkCommitRecordMapper.deleteCheckCommitRecordByPdGuid(pdGuid);
}
}

View File

@@ -123,4 +123,17 @@ public class CheckStockinController extends BaseController
String stockOutId = checkStockinService.saveBill(checkStockVo);
return AjaxResult.success(stockOutId);
}
/**
* 盘点自动分配
* @param checkStockin
* @return
*/
@Log(title = "盘点自动分配", businessType = BusinessType.OTHER)
@PostMapping("/autoAllocation")
@PreAuthorize("@ss.hasPermi('check:stockCheck:autoAllocation')")
@ResponseBody
public AjaxResult autoAllocation(@RequestBody CheckStockin checkStockin) {
return checkStockinService.autoAllocation(checkStockin);
}
}

View File

@@ -1,5 +1,6 @@
package com.ruoyi.check.stockcheck.mapper;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
@@ -60,4 +61,7 @@ public interface CheckStockinMapper
public int deleteCheckStockinByStockGuids(String[] stockGuids);
void insertCheckStockinHistory(CheckStockin checkStockin);
void autoAllot(HashMap<String, String> map);
}

View File

@@ -64,4 +64,11 @@ public interface ICheckStockinService
public int deleteCheckStockinByStockGuid(String stockGuid);
String saveBill(CheckStockVo outStockoutVo);
/**
* 盘点自动分配
* @param checkStockin
* @return
*/
AjaxResult autoAllocation(CheckStockin checkStockin);
}

View File

@@ -3,7 +3,9 @@ package com.ruoyi.check.stockcheck.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
@@ -22,6 +24,8 @@ import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.service.IBasStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
@@ -47,6 +51,8 @@ public class CheckStockinServiceImpl implements ICheckStockinService
private ICheckStockinDetailService checkStockinDetailService;
@Autowired
private IBasProductService productService;
@Autowired
private IBasStockService basStockService;
/**
* 查询盘库单据主信息
@@ -165,6 +171,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService
@Transactional(rollbackFor = Exception.class)
public String saveBill(CheckStockVo checkStockVo) {
CheckStockin checkStockin = checkStockVo.getCheckStockin();
List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
String stockCheckId = basJobIdService.getJobId("PDD");
checkStockin.setStockCheckId(stockCheckId);
@@ -175,6 +182,8 @@ public class CheckStockinServiceImpl implements ICheckStockinService
checkStockin.setStatus("1");
checkStockin.setStockSource("0");
checkStockin.setCheckType(checkStockin.getCheckType());
if ("1".equals(checkStockin.getCheckType())){
//物料盘点
for (int i = 0; i < detailList.size(); i++) {
CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
@@ -186,7 +195,40 @@ public class CheckStockinServiceImpl implements ICheckStockinService
checkStockinDetail.setAssignNum("0");
checkStockinDetailService.insertCheckStockinDetail(checkStockinDetail);
}
}else if ("2".equals(checkStockin.getCheckType())){
//货位盘点
for (int i = 0; i < detailList.size(); i++) {
BasStock param = new BasStock();
param.setCargoSpaceId(detailList.get(i).getSpare1());
List<BasStock> basStocks = basStockService.selectBasStockList(param);
Integer quantity = 0;
for (BasStock basStock : basStocks) {
quantity += Convert.toInt(basStock.getQuantity());
}
CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setQuantity(quantity.toString());
checkStockinDetail.setScanNum("0");
checkStockinDetail.setAssignNum("0");
checkStockinDetailService.insertCheckStockinDetail(checkStockinDetail);
}
}
checkStockinMapper.insertCheckStockin(checkStockin);
return stockCheckId;
}
@Override
public AjaxResult autoAllocation(CheckStockin checkStockin) {
HashMap<String, String> map = new HashMap<>();
map.put("v_stock_check_id", checkStockin.getStockCheckId());
checkStockinMapper.autoAllot(map);
if ("10".equals(map.get("v_result"))){
return AjaxResult.success("自动分配成功");
}else {
return AjaxResult.warn(map.get("v_resultString"));
}
}
}

View File

@@ -132,9 +132,18 @@ public class CheckStockinDetail extends BaseEntity
private String spare6;
private String status;
private String cargoSpaceName;
private ExtraField extraField;
public String getCargoSpaceName() {
return cargoSpaceName;
}
public void setCargoSpaceName(String cargoSpaceName) {
this.cargoSpaceName = cargoSpaceName;
}
public ExtraField getExtraField() {
return extraField;
}

View File

@@ -182,5 +182,16 @@ public class PdaController extends BaseController {
public AjaxResult outMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.outMakeSure(trayCodeMakeSure);
}
/**
* 出库确认
* @param trayCodeMakeSure 托盘信息
* @return
*/
@PostMapping("/checkMakeSure")
@ResponseBody
public AjaxResult checkMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.checkMakeSure(trayCodeMakeSure);
}
}

View File

@@ -17,4 +17,6 @@ public interface PdaMapper {
void addInJob(HashMap<String, Object> map);
void outMakeSure(HashMap<String, Object> map);
void checkMakeSure(HashMap<String, Object> map);
}

View File

@@ -24,4 +24,6 @@ public interface PdaService {
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure);
}

View File

@@ -7,6 +7,8 @@ import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.bas.containerDetails.domain.BasContainerDetails;
import com.ruoyi.bas.containerDetails.service.IBasContainerDetailsService;
import com.ruoyi.check.commit.domain.CheckCommitRecord;
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.service.IMydoJobService;
@@ -52,6 +54,8 @@ public class PdaServiceImp implements PdaService{
ITrayMsgService trayMsgService;
@Autowired
private IBasContainerDetailsService basContainerDetailsService;
@Autowired
private ICheckCommitRecordService checkCommitRecordService;
/**
* 空托盘入库
@@ -244,4 +248,28 @@ public class PdaServiceImp implements PdaService{
return AjaxResult.warn("拣选完成");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
if(CollUtil.isNotEmpty(mydoJobDetailList)){
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
CheckCommitRecord checkCommitRecord = new CheckCommitRecord();
checkCommitRecord.setQuantity(mydoJobDetail.getInQuantity());
checkCommitRecord.setTrayCode(trayCodeMakeSure.getTrayCode());
checkCommitRecord.setStockId(mydoJobDetail.getStockId());
checkCommitRecordService.insertCheckCommitRecord(checkCommitRecord);
}
}
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
pdaMapper.checkMakeSure(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());
}
}
}

View File

@@ -114,10 +114,22 @@ public class BasStock extends BaseEntity
/** 备用字段6 */
@Excel(name = "备用字段6")
private String spare6;
//额外字段
private ExtraField extraField;
//物料名称
private String productName;
//货位是否锁定
private String cargoSpaceStatus;
//货位库存状态
private String cargoSpaceStockStatus;
public String getCargoSpaceStockStatus() {
return cargoSpaceStockStatus;
}
public void setCargoSpaceStockStatus(String cargoSpaceStockStatus) {
this.cargoSpaceStockStatus = cargoSpaceStockStatus;
}
public String getCargoSpaceName() {
return cargoSpaceName;

View File

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.ruoyi.bas.cargoSpace.domain.BasCargoSpace" id="BasCargoSpaceResult">
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="roadwayId" column="roadway_id" />
<result property="cargoAreaId" column="cargo_area_id" />
<result property="theType" column="the_type" />
@@ -27,30 +28,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBasCargoSpaceVo">
select cargo_space_id, warehouse_id, roadway_id, cargo_area_id, the_type, the_type_name, cargo_space_name, the_platoon, the_column, the_floor, status, locked, tray_code, cargo_hight, iss_double, group_coding_no, group_coding, cargo_space_logo, this_cargo_area from bas_cargo_space
select
bcs.cargo_space_id,
bcs.warehouse_id,
bcs.roadway_id,
bcs.cargo_area_id,
bcs.the_type,
bcs.the_type_name,
bcs.cargo_space_name,
bcs.the_platoon,
bcs.the_column,
bcs.the_floor,
bcs.status,
bcs.locked,
bcs.tray_code,
bcs.cargo_hight,
bcs.iss_double,
bcs.group_coding_no,
bcs.group_coding,
bcs.cargo_space_logo,
bcs.this_cargo_area,
bw.warehouse_name
from bas_cargo_space bcs
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
</sql>
<select id="selectBasCargoSpaceList" resultMap="BasCargoSpaceResult">
<include refid="selectBasCargoSpaceVo"/>
<where>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''"> and cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''"> and the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''"> and the_type_name like concat('%', #{theTypeName}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="thePlatoon != null "> and the_platoon = #{thePlatoon}</if>
<if test="theColumn != null "> and the_column = #{theColumn}</if>
<if test="theFloor != null "> and the_floor = #{theFloor}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="locked != null and locked != ''"> and locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="cargoHight != null and cargoHight != ''"> and cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''"> and iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''"> and group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''"> and group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''"> and cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="thisCargoArea != null and thisCargoArea != ''"> and this_cargo_area = #{thisCargoArea}</if>
<if test="warehouseId != null and warehouseId != ''"> and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''"> and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''"> and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''"> and bcs.the_type_name like concat('%', #{theTypeName}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="thePlatoon != null "> and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null "> and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null "> and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''"> and bcs.status = #{status}</if>
<if test="locked != null and locked != ''"> and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''"> and bcs.tray_code = #{trayCode}</if>
<if test="cargoHight != null and cargoHight != ''"> and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''"> and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''"> and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''"> and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''"> and bcs.cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="thisCargoArea != null and thisCargoArea != ''"> and bcs.this_cargo_area = #{thisCargoArea}</if>
</where>
</select>

View File

@@ -0,0 +1,82 @@
<?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.check.commit.mapper.CheckCommitRecordMapper">
<resultMap type="CheckCommitRecord" id="CheckCommitRecordResult">
<result property="pdGuid" column="pd_guid" />
<result property="trayCode" column="tray_code" />
<result property="stockId" column="stock_id" />
<result property="quantity" column="quantity" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
</resultMap>
<sql id="selectCheckCommitRecordVo">
select pd_guid, tray_code, stock_id, quantity, spare1, spare2, spare3 from check_commit_record
</sql>
<select id="selectCheckCommitRecordList" parameterType="CheckCommitRecord" resultMap="CheckCommitRecordResult">
<include refid="selectCheckCommitRecordVo"/>
<where>
<if test="pdGuid != null "> and pd_guid = #{pdGuid}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</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>
</where>
</select>
<select id="selectCheckCommitRecordByPdGuid" parameterType="Long" resultMap="CheckCommitRecordResult">
<include refid="selectCheckCommitRecordVo"/>
where pd_guid = #{pdGuid}
</select>
<insert id="insertCheckCommitRecord" parameterType="CheckCommitRecord" useGeneratedKeys="true" keyProperty="pdGuid">
insert into check_commit_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="trayCode != null">tray_code,</if>
<if test="stockId != null">stock_id,</if>
<if test="quantity != null">quantity,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="trayCode != null">#{trayCode},</if>
<if test="stockId != null">#{stockId},</if>
<if test="quantity != null">#{quantity},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
</trim>
</insert>
<update id="updateCheckCommitRecord" parameterType="CheckCommitRecord">
update check_commit_record
<trim prefix="SET" suffixOverrides=",">
<if test="trayCode != null">tray_code = #{trayCode},</if>
<if test="stockId != null">stock_id = #{stockId},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
</trim>
where pd_guid = #{pdGuid}
</update>
<delete id="deleteCheckCommitRecordByPdGuid" parameterType="Long">
delete from check_commit_record where pd_guid = #{pdGuid}
</delete>
<delete id="deleteCheckCommitRecordByPdGuids" parameterType="String">
delete from check_commit_record where pd_guid in
<foreach item="pdGuid" collection="array" open="(" separator="," close=")">
#{pdGuid}
</foreach>
</delete>
</mapper>

View File

@@ -67,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="cargoSpaceName" column="cargo_space_name" />
<association property="extraField" javaType="ExtraField">
<result property="productId" column="product_id" />
<result property="materialDesc" column="product_name" />
@@ -85,9 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
csd.assign_num_j, csd.print_date, csd.stock_status, csd.supplier_id, csd.customer_id, csd.unit, csd.spec,
csd.scan_num, csd.scan_num_x, csd.scan_num_j, csd.spare1, csd.spare2, csd.spare3, csd.spare4,csd.spare5, csd.spare6,
bp.product_name,bp.spare1 as englishDesc,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,
bcs.cargo_space_name
from check_stockin_detail_finish csd
left join bas_product bp on csd.product_id = bp.product_id
left join bas_cargo_space bcs on csd.spare1 = bcs.cargo_space_id
</sql>
<sql id="selectCheckStockinDetailFinishVo">

View File

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="cargoSpaceName" column="cargo_space_name" />
<association property="extraField" javaType="ExtraField">
<result property="productId" column="product_id" />
<result property="materialDesc" column="product_name" />
@@ -53,9 +54,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
csd.assign_num_j, csd.print_date, csd.stock_status, csd.supplier_id, csd.customer_id, csd.unit, csd.spec,
csd.scan_num, csd.scan_num_x, csd.scan_num_j, csd.spare1, csd.spare2, csd.spare3, csd.spare4,csd.spare5, csd.spare6,
bp.product_name,bp.spare1 as englishDesc,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,
bcs.cargo_space_name
from check_stockin_detail csd
left join bas_product bp on csd.product_id = bp.product_id
left join bas_cargo_space bcs on csd.spare1 = bcs.cargo_space_id
</sql>
<select id="selectCheckStockinDetailList" parameterType="CheckStockinDetail" resultMap="CheckStockinDetailResult">

View File

@@ -62,6 +62,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectCheckStockinVo"/>
where stock_guid = #{stockGuid}
</select>
<select id="autoAllot" parameterType="java.util.Map" statementType="CALLABLE">
{
call proc_check_auto_allocation(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)
}
</select>
<insert id="insertCheckStockin" parameterType="CheckStockin">
insert into check_stockin

View File

@@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="autoAllot" parameterType="java.util.Map" statementType="CALLABLE">
{
call proc_auto_allocation(
call proc_out_auto_allocation(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}

View File

@@ -68,4 +68,11 @@
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<select id="checkMakeSure" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_check_masksure(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
</mapper>

View File

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="cargoSpaceStatus" column="locked" />
<result property="cargoSpaceStockStatus" column="cargoSpaceStockStatus" />
<result property="warehouseName" column="warehouse_name" />
<result property="cargoSpaceName" column="cargo_space_name" />
<association property="extraField" javaType="ExtraField">
@@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bs.stockin_detail_id, bs.stockin_id, bs.in_type, bs.in_class_id, bs.warehouse_id, bs.stacking_id,
bs.spare1, bs.spare2, bs.spare3, bs.spare4, bs.spare5, bs.spare6 ,bp.product_name,bp.spare1 as englishDesc,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,bw.warehouse_name,bs.product_id,
bcs.locked,bcs.cargo_space_name
bcs.locked,bcs.cargo_space_name,bcs.status as cargoSpaceStockStatus
from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare4 != null and spare4 != ''"> and bs.spare4 = #{spare4}</if>
<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>
</where>
</select>

View File

@@ -392,6 +392,7 @@ export default {
quantityExceedError: 'Quantity cannot exceed stock quantity',
saveSuccess: 'Document {msg} saved successfully',
lotNo:'lotNo',
cargoSpaceName: 'cargoSpaceName',
},
//***************盘点单据管理***************
checkStockCheck: {

View File

@@ -360,6 +360,7 @@ export default {
quantityExceedError: '数量不能大于库存数量',
saveSuccess: '单据{msg}保存成功',
lotNo:'批次号',
cargoSpaceName: 'cargoSpaceName',
},
//***************盘点单据管理***************
checkStockCheck: {

View File

@@ -362,6 +362,13 @@ export default {
quantityExceedError: '数量不能大于库存数量',
saveSuccess: '单据{msg}保存成功',
lotNo:'批次号',
cargoSpaceName: '货位名称',
trayCode: '托盘码',
inputTrayCode: '请输入托盘码',
inputCargoSpaceName: '请输入货位名称',
selectTrayCode:"选择托盘",
trayDetail:"物资详情",
close: '关闭',
},
//***************盘点单据管理***************
checkStockCheck: {
@@ -407,7 +414,9 @@ export default {
reviewSuccess: '审核成功',
onlyUnreviewedCanReview: '只有未审核的单据可以审核',
confirmSuccess: '确认成功',
onlyReviewedCanConfirm: '只有已审核的单据可以确认'
onlyReviewedCanConfirm: '只有已审核的单据可以确认',
cargoSpaceName: '货位名称',
autoAllocation:'自动分配'
},
// ***************盘点入库作业*************
checkJobIn: {

View File

@@ -20,7 +20,7 @@
/>
</el-form-item>-->
<el-form-item :label="$t('checkCreate.documentType')" prop="checkType" required> <!-- 单据类型 -->
<el-select v-model="formData.checkType" :placeholder="$t('checkCreate.selectDocumentType')" clearable>
<el-select v-model="formData.checkType" :placeholder="$t('checkCreate.selectDocumentType')" clearable @change="handleCheckTypeChange">
<el-option
v-for="dict in dict.type.check_stock_type"
:key="dict.value"
@@ -44,17 +44,10 @@
<el-table v-loading="loading" :data="materialList">
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="productId" /> <!-- 物资编号 -->
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="productName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.batchNo')" align="center" prop="lotNo"> <!-- 批号 -->
<template slot-scope="scope">
<el-input v-model="scope.row.lotNo" size="mini" :placeholder="$t('checkCreate.inputBatchNo')" />
</template>
</el-table-column>
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity"> <!-- 数量 -->
<template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
</template>
</el-table-column>
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.batchNo')" align="center" prop="lotNo"/> <!-- 批号 -->
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" /> <!-- 数量 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 仓库名称 -->
<el-table-column :label="$t('checkCreate.cargoSpaceName')" align="center" prop="cargoSpaceName" /> <!-- 货位名称 -->
<el-table-column :label="$t('checkCreate.operation')" align="center" class-name="small-padding fixed-width"> <!-- 操作 -->
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.$index)">{{ $t('checkCreate.delete') }}</el-button> <!-- 删除 -->
@@ -62,8 +55,8 @@
</el-table-column>
</el-table>
<!-- 选择物资弹窗 -->
<el-dialog :title="$t('checkCreate.selectMaterial')" :visible.sync="materialDialog" width="800px" append-to-body> <!-- 选择物资 -->
<!-- 选择物料物资弹窗 -->
<el-dialog :title="$t('checkCreate.selectMaterial')" :visible.sync="materialDialogByProduct" width="800px" append-to-body> <!-- 选择物资 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="$t('checkCreate.materialCode')" prop="productId"> <!-- 物资编码 -->
<el-input
@@ -89,16 +82,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('checkCreate.selectWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
:label="dict.warehouseName"
:value="dict.warehouseId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('checkCreate.search') }}</el-button> <!-- 搜索 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('checkCreate.reset') }}</el-button> <!-- 重置 -->
@@ -110,8 +93,8 @@
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="productName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" /> <!-- 数量 -->
<el-table-column :label="$t('checkCreate.lotNo')" align="center" prop="lotNo" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.lotNo')" align="center" prop="lotNo" /> <!-- 批次 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 仓库 -->
</el-table>
@@ -120,6 +103,71 @@
<el-button @click="cancelSelectMaterials">{{ $t('checkCreate.cancel') }}</el-button> <!-- 取消 -->
</div>
</el-dialog>
<!-- 选择托盘弹窗 -->
<el-dialog :title="$t('checkCreate.selectTrayCode')" :visible.sync="materialDialogByTrayCode" width="800px" append-to-body>
<el-form :model="trayQueryParams" ref="trayQueryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="$t('checkCreate.cargoSpaceName')" prop="cargoSpaceName">
<el-input
v-model="trayQueryParams.cargoSpaceName"
:placeholder="$t('checkCreate.inputCargoSpaceName')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item :label="$t('checkCreate.trayCode')" prop="trayCode">
<el-input
v-model="trayQueryParams.trayCode"
:placeholder="$t('checkCreate.inputTrayCode')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item :label="$t('checkCreate.materialName')" prop="productName">
<el-input
v-model="trayQueryParams.productName"
:placeholder="$t('checkCreate.inputMaterialName')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleTrayQuery">{{ $t('checkCreate.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetTrayQuery">{{ $t('checkCreate.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="trayLoading" :data="trayOptions" @selection-change="handleTraySelectionChange" @row-click="handleRowClick">
<el-table-column type="selection" width="55" />
<el-table-column :label="$t('checkCreate.trayCode')" align="center" prop="trayCode" />
<el-table-column :label="$t('checkCreate.cargoSpaceName')" align="center" prop="cargoSpaceName" />
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" />
</el-table>
<!-- 托盘详情弹窗 -->
<el-dialog
:title="$t('checkCreate.trayDetail')"
:visible.sync="trayDetailVisible"
width="600px"
append-to-body
>
<el-table :data="trayDetailList">
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="extraField.productId" />
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="extraField.materialDesc" />
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="trayDetailVisible = false">{{ $t('checkCreate.close') }}</el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectMaterials">{{ $t('checkCreate.confirm') }}</el-button>
<el-button @click="cancelSelectMaterials">{{ $t('checkCreate.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -127,23 +175,25 @@
import { listProductAndStock } from "@/api/out/outStockout";
import { listWarehouse } from "@/api/bas/warehouse";
import { saveCheckStock } from "@/api/check/stockCheck";
import { listManagement} from "@/api/stock/management"
import { listCargoSpace} from "@/api/bas/cargoSpace"
export default {
name: "AddOutStock",
dicts: ['check_stock_type', 'bill_status'],
data() {
return {
// 上一次选择的单据类型
oldCheckType: null,
// 遮罩层
loading: false,
materialLoading: false,
trayLoading: false,
// 表单验证规则
rules: {
warehouseId: [
{ required: true, message: this.$t('checkCreate.warehouseRequired'), trigger: "change" }
],
customerNo: [
{ required: true, message: this.$t('checkCreate.customerRequired'), trigger: "blur" }
],
billType: [
{ required: true, message: this.$t('checkCreate.documentTypeRequired'), trigger: "change" }
]
@@ -159,12 +209,17 @@
// 物资明细列表
materialList: [],
// 选择物资弹窗
materialDialog: false,
// 物资选项数据
materialDialogByProduct: false,
materialDialogByTrayCode: false,
// 物资选择列表
materialOptions: [],
// 托盘选择列表
trayOptions: [],
// 已选择的物资
selectedMaterials: [],
// 查询参数
// 已选择的托盘
selectedTrays: [],
// 物资查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
@@ -174,8 +229,22 @@
productName: null,
quantity: null,
warehouseId: null
},
// 托盘查询参数
trayQueryParams: {
pageNum: 1,
pageSize: 10,
trayCode: null,
productName: null,
cargoSpaceName: null,
warehouseId: null,
status: null
},
// 托盘详情弹窗显示状态
trayDetailVisible: false,
// 托盘详情列表
trayDetailList: []
}
};
},
created() {
this.getWarehouseOptions();
@@ -183,30 +252,92 @@
methods: {
/** 获取仓库选项 */
getWarehouseOptions() {
listWarehouse().then(response => {
var param = {
pageNum:1,
pageSize:99,
typeData:['1','2']
}
listWarehouse(param).then(response => {
this.warehouseOptions = response.rows;
});
},
/** 打开选择物资弹窗 */
handleSelectMaterials() {
this.materialDialog = true;
if (!this.formData.warehouseId) {
this.$modal.msgError(this.$t('checkCreate.warehouseRequired'));
return;
}
if (!this.formData.checkType){
this.$modal.msgError(this.$t('checkCreate.documentTypeRequired'));
return;
}
if (this.formData.checkType==='1'){
this.materialDialogByProduct = true;
// 设置查询参数中的仓库ID为主表选择的仓库
this.queryParams.warehouseId = this.formData.warehouseId;
this.getMaterialList();
}else if (this.formData.checkType==='2'){
this.materialDialogByTrayCode = true;
// 设置查询参数中的仓库ID为主表选择的仓库
this.queryParams.warehouseId = this.formData.warehouseId;
this.getMaterialByTrayCodeList();
}
},
/** 获取物资列表 */
getMaterialList() {
this.materialLoading = true;
if (this.formData.checkType==='1'){
listProductAndStock(this.queryParams).then(response => {
this.materialOptions = response.rows;
this.materialLoading = false;
});
}
},
/* 获取托盘物资列表*/
getMaterialByTrayCodeList(){
this.trayLoading = true;
if (this.formData.checkType==='2'){
this.trayQueryParams.warehouseId = this.formData.warehouseId;
this.trayQueryParams.status = 2;
listCargoSpace(this.trayQueryParams).then(response => {
this.trayOptions = response.rows;
this.trayLoading = false;
});
}
},
/** 物资选择变更 */
handleSelectionChange(selection) {
this.selectedMaterials = selection;
},
/** 托盘选择变更 */
handleTraySelectionChange(selection) {
this.selectedTrays = selection;
},
/** 托盘行点击事件 */
handleRowClick(row) {
if (this.formData.checkType === '2' && row.trayCode) {
const params = {
pageNum: 1,
pageSize: 10,
trayCode: row.trayCode,
warehouseId: this.formData.warehouseId
};
listManagement(params).then(response => {
this.trayDetailList = response.rows;
this.trayDetailVisible = true;
});
}
},
/** 确认选择物资 */
confirmSelectMaterials() {
if (this.formData.checkType === '1') {
this.confirmSelectMaterialsByProduct();
} else if (this.formData.checkType === '2') {
this.confirmSelectMaterialsByTray();
}
},
/** 确认选择物料物资 */
confirmSelectMaterialsByProduct() {
if (this.selectedMaterials.length === 0) {
this.$modal.msgError(this.$t('checkCreate.selectMaterialRequired'));
return;
@@ -227,45 +358,87 @@
productGuId: item.productGuid,
productName: item.productName,
quantity: item.quantity,
quantityOrignal: item.quantity,
lotNo: item.lotNo,
onlyIdentity: item.onlyIdentity,
warehouseId: item.warehouseId,
warehouseName: item.warehouseName
warehouseName: item.warehouseName,
cargoSpaceId: item.cargoSpaceId,
cargoSpaceName: item.cargoSpaceName
}))
);
this.materialDialog = false;
this.materialDialogByProduct = false;
this.selectedMaterials = [];
},
/** 确认选择托盘物资 */
confirmSelectMaterialsByTray() {
if (this.selectedTrays.length === 0) {
this.$modal.msgError(this.$t('checkCreate.selectTrayRequired'));
return;
}
// 过滤掉已经存在的托盘
const newTrays = this.selectedTrays.filter(item => {
return !this.materialList.some(existing => existing.trayCode === item.trayCode);
});
if (newTrays.length === 0) {
this.$modal.msgWarning(this.$t('checkCreate.trayExistWarning'));
return;
}
this.materialList = this.materialList.concat(
newTrays.map(item => ({
trayCode: item.trayCode,
warehouseId: item.warehouseId,
warehouseName: item.warehouseName,
spare1: item.cargoSpaceId,
cargoSpaceName: item.cargoSpaceName
}))
);
this.materialDialogByTrayCode = false;
this.selectedTrays = [];
},
/** 取消选择物资 */
cancelSelectMaterials() {
this.selectedMaterials = [];
this.materialDialog = false;
if (this.formData.checkType === '1') {
this.cancelSelectMaterialsByProduct();
} else if (this.formData.checkType === '2') {
this.cancelSelectMaterialsByTray();
}
},
/** 搜索按钮操作 */
/** 取消选择物料物资 */
cancelSelectMaterialsByProduct() {
this.selectedMaterials = [];
this.materialDialogByProduct = false;
},
/** 取消选择托盘物资 */
cancelSelectMaterialsByTray() {
this.selectedTrays = [];
this.materialDialogByTrayCode = false;
},
/** 物资搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getMaterialList();
},
/** 重置按钮操作 */
/** 物资重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 托盘搜索按钮操作 */
handleTrayQuery() {
this.trayQueryParams.pageNum = 1;
this.getMaterialByTrayCodeList();
},
/** 托盘重置按钮操作 */
resetTrayQuery() {
this.resetForm("trayQueryForm");
this.handleTrayQuery();
},
/** 删除物资 */
handleDelete(index) {
this.materialList.splice(index, 1);
},
/** 数量变更 */
handleQuantityChange(row) {
// 如果没有初始数量,则设置初始数量
// 如果修改后的数量大于初始数量,给出提示并重置为当前值
if (row.quantity > row.quantityOrignal) {
this.$modal.msgError(this.$t('checkCreate.quantityExceedError'));
row.quantity = row.quantityOrignal;
}
},
/** 保存单据 */
handleSave() {
this.$refs.formRef.validate(valid => {
@@ -288,6 +461,17 @@
}
});
},
/** 单据类型变更处理 */
handleCheckTypeChange(value) {
if (this.materialList.length > 0) {
this.$modal.msgWarning(this.$t('checkCreate.cannotChangeTypeWithMaterials'));
this.$nextTick(() => {
this.formData.checkType = this.oldCheckType;
});
return;
}
this.oldCheckType = value;
},
/** 重置数据 */
reset() {
this.formData = {
@@ -300,7 +484,7 @@
/** 重新建单 */
handleReload() {
this.$tab.refreshPage(this.$route);
}
},
}
};
</script>

View File

@@ -172,6 +172,17 @@
v-hasPermi="['check:stockCheck:edit']"
>{{$t('checkStockCheck.review')}}</el-button> <!-- 单据审核 -->
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleAutoAllocation"
v-hasPermi="['check:stockCheck:autoAllocation']"
>{{$t('checkStockCheck.autoAllocation')}}</el-button> <!-- 自动分配 -->
</el-col>
<el-col :span="1.5">
<el-button
type="success"
@@ -184,6 +195,8 @@
>{{$t('checkStockCheck.confirm')}}</el-button> <!-- 单据确认 -->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -223,6 +236,7 @@
<el-table-column :label="$t('checkStockCheck.detailId')" align="center" prop="stockCheckDetailId" /> <!-- 子单ID -->
<!-- <el-table-column label="主单GUID" align="center" prop="stockCheckGuid" /> -->
<el-table-column :label="$t('checkStockCheck.mainId')" align="center" prop="stockCheckId" /> <!-- 主单ID -->
<el-table-column :label="$t('checkStockCheck.cargoSpaceName')" align="center" prop="cargoSpaceName" /> <!-- 货位名称 -->
<el-table-column :label="$t('checkStockCheck.lotNo')" align="center" prop="lotNo"/> <!-- 批次号 -->
<!-- <el-table-column label="物料ID" align="center" prop="productGuid"/>-->
<el-table-column :label="$t('checkStockCheck.productId')" align="center" prop="productId"/> <!-- 物料编码 -->
@@ -504,6 +518,9 @@ export default {
this.$modal.msgError(this.$t('checkStockCheck.onlyReviewedCanConfirm'))
}
},
handleAutoAllocation(row){
}
}
}
</script>