库存页面 入库页面手动完成和手动作废
This commit is contained in:
@@ -101,4 +101,26 @@ public class MydoJobController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动作废任务表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualInvalidation')")
|
||||||
|
@Log(title = "任务表", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/manualInvalidation")
|
||||||
|
public AjaxResult manualInvalidation(@RequestBody MydoJob mydoJob)
|
||||||
|
{
|
||||||
|
return mydoJobService.manualInvalidation(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动完成任务表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCompleted')")
|
||||||
|
@Log(title = "任务表", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/manualCompleted")
|
||||||
|
public AjaxResult manualCompleted(@RequestBody MydoJob mydoJob)
|
||||||
|
{
|
||||||
|
return mydoJobService.manualCompleted(mydoJob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,6 @@ public interface MydoJobMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMydoJobByJobIds(String[] jobIds);
|
public int deleteMydoJobByJobIds(String[] jobIds);
|
||||||
|
|
||||||
|
void insertHistory(String jobId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.job.mydojob.service;
|
package com.ruoyi.job.mydojob.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,4 +60,18 @@ public interface IMydoJobService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMydoJobByJobId(String jobId);
|
public int deleteMydoJobByJobId(String jobId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动作废任务
|
||||||
|
* @param mydoJob
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult manualInvalidation(MydoJob mydoJob);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动完成任务
|
||||||
|
* @param mydoJob
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult manualCompleted(MydoJob mydoJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
package com.ruoyi.job.mydojob.service.impl;
|
package com.ruoyi.job.mydojob.service.impl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||||
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||||
|
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||||
|
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||||
|
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||||
|
import com.ruoyi.stock.stock.domain.BasStock;
|
||||||
|
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
|
import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务表Service业务层处理
|
* 任务表Service业务层处理
|
||||||
@@ -27,6 +38,13 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
private IBasJobIdService basJobIdService;
|
private IBasJobIdService basJobIdService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBasTaskNoService basTaskNoService;
|
private IBasTaskNoService basTaskNoService;
|
||||||
|
@Autowired
|
||||||
|
private IMydoJobDetailService mydoJobDetailService;
|
||||||
|
@Autowired
|
||||||
|
private IInStockinDetailService inStockinDetailService;
|
||||||
|
@Autowired
|
||||||
|
private IBasStockService basStockService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务表
|
* 查询任务表
|
||||||
@@ -102,4 +120,95 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
{
|
{
|
||||||
return mydoJobMapper.deleteMydoJobByJobId(jobId);
|
return mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 手动作废任务表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult manualInvalidation(MydoJob mydoJob) {
|
||||||
|
String jobId = mydoJob.getJobId();
|
||||||
|
MydoJob job = selectMydoJobByJobId(jobId);
|
||||||
|
if (job == null){
|
||||||
|
return AjaxResult.warn("任务不存在");
|
||||||
|
}
|
||||||
|
MydoJobDetail param = new MydoJobDetail();
|
||||||
|
param.setJobId(jobId);
|
||||||
|
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||||
|
|
||||||
|
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||||
|
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||||
|
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inOrOutDId);
|
||||||
|
BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
|
||||||
|
BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
|
||||||
|
BigDecimal subtract = stockInNum.subtract(jobInNum);
|
||||||
|
inStockinDetail.setScanNum(Convert.toStr(subtract));
|
||||||
|
inStockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||||
|
}
|
||||||
|
mydoJob.setStatus("5");
|
||||||
|
updateMydoJob(mydoJob);
|
||||||
|
//插入历史表
|
||||||
|
insertHistory(mydoJob.getJobId());
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入历史表
|
||||||
|
* @param jobId
|
||||||
|
*/
|
||||||
|
private void insertHistory(String jobId) {
|
||||||
|
mydoJobMapper.insertHistory(jobId);
|
||||||
|
mydoJobDetailService.insertHistory(jobId);
|
||||||
|
mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||||
|
mydoJobDetailService.deleteMydoJobDetailByJobId(jobId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动完成任务表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult manualCompleted(MydoJob mydoJob) {
|
||||||
|
//插入库存
|
||||||
|
|
||||||
|
String jobId = mydoJob.getJobId();
|
||||||
|
MydoJob job = selectMydoJobByJobId(jobId);
|
||||||
|
if (job == null){
|
||||||
|
return AjaxResult.warn("任务不存在");
|
||||||
|
}
|
||||||
|
MydoJobDetail param = new MydoJobDetail();
|
||||||
|
param.setJobId(jobId);
|
||||||
|
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||||
|
if (CollUtil.isNotEmpty(mydoJobDetails)){
|
||||||
|
List<BasStock> list = new ArrayList<>();
|
||||||
|
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||||
|
list.add(getStockByInStockinDetail(mydoJobDetail,job));
|
||||||
|
}
|
||||||
|
basStockService.insertBasStockList(list);
|
||||||
|
mydoJob.setStatus("4");
|
||||||
|
updateMydoJob(mydoJob);
|
||||||
|
//插入历史表
|
||||||
|
insertHistory(mydoJob.getJobId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
private BasStock getStockByInStockinDetail(MydoJobDetail mydoJobDetail,MydoJob mydoJob) {
|
||||||
|
BasStock stock = new BasStock();
|
||||||
|
stock.setStockId(basJobIdService.getJobId("KC"));
|
||||||
|
stock.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||||
|
stock.setStockStatus("1");
|
||||||
|
stock.setProductStatus("1");
|
||||||
|
stock.setLotNo(mydoJobDetail.getLotNo());
|
||||||
|
stock.setInDate(DateUtils.getDate());
|
||||||
|
stock.setProductGuid(mydoJobDetail.getProductGuid());
|
||||||
|
stock.setQuantity(mydoJobDetail.getInQuantity());
|
||||||
|
stock.setJobId(mydoJob.getJobId());
|
||||||
|
stock.setTrayCode(mydoJob.getTrayCode());
|
||||||
|
stock.setInClassId(mydoJob.getClassId());
|
||||||
|
stock.setWarehouseId(mydoJob.getWarehouseId());
|
||||||
|
stock.setStackingId(mydoJobDetail.getStackingId());
|
||||||
|
return stock;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,8 @@ public interface MydoJobDetailMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMydoJobDetailByJobDetailIds(String[] jobDetailIds);
|
public int deleteMydoJobDetailByJobDetailIds(String[] jobDetailIds);
|
||||||
|
|
||||||
|
void insertHistory(String jobId);
|
||||||
|
|
||||||
|
void deleteMydoJobDetailByJobId(String jobId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,8 @@ public interface IMydoJobDetailService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMydoJobDetailByJobDetailId(String jobDetailId);
|
public int deleteMydoJobDetailByJobDetailId(String jobDetailId);
|
||||||
|
|
||||||
|
void insertHistory(String jobId);
|
||||||
|
|
||||||
|
void deleteMydoJobDetailByJobId(String jobId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,4 +90,14 @@ public class MydoJobDetailServiceImpl implements IMydoJobDetailService
|
|||||||
{
|
{
|
||||||
return mydoJobDetailMapper.deleteMydoJobDetailByJobDetailId(jobDetailId);
|
return mydoJobDetailMapper.deleteMydoJobDetailByJobDetailId(jobDetailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertHistory(String jobId) {
|
||||||
|
mydoJobDetailMapper.insertHistory(jobId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMydoJobDetailByJobId(String jobId) {
|
||||||
|
mydoJobDetailMapper.deleteMydoJobDetailByJobId(jobId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.stock.stock.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.stock.stock.domain.BasStock;
|
||||||
|
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存信息Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-24
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/stock/management")
|
||||||
|
public class BasStockController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IBasStockService basStockService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(BasStock basStock)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BasStock> list = basStockService.selectBasStockList(basStock);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出库存信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:export')")
|
||||||
|
@Log(title = "库存信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, BasStock basStock)
|
||||||
|
{
|
||||||
|
List<BasStock> list = basStockService.selectBasStockList(basStock);
|
||||||
|
ExcelUtil<BasStock> util = new ExcelUtil<BasStock>(BasStock.class);
|
||||||
|
util.exportExcel(response, list, "库存信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取库存信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:query')")
|
||||||
|
@GetMapping(value = "/{stockId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("stockId") String stockId)
|
||||||
|
{
|
||||||
|
return success(basStockService.selectBasStockByStockId(stockId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增库存信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:add')")
|
||||||
|
@Log(title = "库存信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody BasStock basStock)
|
||||||
|
{
|
||||||
|
return toAjax(basStockService.insertBasStock(basStock));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改库存信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:edit')")
|
||||||
|
@Log(title = "库存信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody BasStock basStock)
|
||||||
|
{
|
||||||
|
return toAjax(basStockService.updateBasStock(basStock));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除库存信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('stock:management:remove')")
|
||||||
|
@Log(title = "库存信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{stockIds}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] stockIds)
|
||||||
|
{
|
||||||
|
return toAjax(basStockService.deleteBasStockByStockIds(stockIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,383 @@
|
|||||||
|
package com.ruoyi.stock.stock.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存信息对象 bas_stock
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-24
|
||||||
|
*/
|
||||||
|
public class BasStock extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 库存id */
|
||||||
|
@Excel(name = "库存id")
|
||||||
|
private String stockId;
|
||||||
|
|
||||||
|
/** 货位id */
|
||||||
|
@Excel(name = "货位id")
|
||||||
|
private String cargoSpaceId;
|
||||||
|
|
||||||
|
/** 库存状态 */
|
||||||
|
@Excel(name = "库存状态")
|
||||||
|
private String stockStatus;
|
||||||
|
|
||||||
|
/** 物料状态 */
|
||||||
|
@Excel(name = "物料状态")
|
||||||
|
private String productStatus;
|
||||||
|
|
||||||
|
/** 批次号 */
|
||||||
|
@Excel(name = "批次号")
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
/** 入库时间 */
|
||||||
|
@Excel(name = "入库时间")
|
||||||
|
private String inDate;
|
||||||
|
|
||||||
|
/** 回流时间 */
|
||||||
|
@Excel(name = "回流时间")
|
||||||
|
private String backDate;
|
||||||
|
|
||||||
|
/** 物料GUID */
|
||||||
|
@Excel(name = "物料GUID")
|
||||||
|
private String productGuid;
|
||||||
|
|
||||||
|
/** 库存数量 */
|
||||||
|
@Excel(name = "库存数量")
|
||||||
|
private String quantity;
|
||||||
|
|
||||||
|
/** 作业ID */
|
||||||
|
@Excel(name = "作业ID")
|
||||||
|
private String jobId;
|
||||||
|
|
||||||
|
/** 托盘条码 */
|
||||||
|
@Excel(name = "托盘条码")
|
||||||
|
private String trayCode;
|
||||||
|
|
||||||
|
/** 出库数量 */
|
||||||
|
@Excel(name = "出库数量")
|
||||||
|
private String outQuantity;
|
||||||
|
|
||||||
|
/** 入库子单id */
|
||||||
|
@Excel(name = "入库子单id")
|
||||||
|
private String stockinDetailId;
|
||||||
|
|
||||||
|
/** 入库主单 */
|
||||||
|
@Excel(name = "入库主单")
|
||||||
|
private String stockinId;
|
||||||
|
|
||||||
|
/** 入库类型 */
|
||||||
|
@Excel(name = "入库类型")
|
||||||
|
private String inType;
|
||||||
|
|
||||||
|
/** 入库班组ID */
|
||||||
|
@Excel(name = "入库班组ID")
|
||||||
|
private String inClassId;
|
||||||
|
|
||||||
|
/** 仓库 */
|
||||||
|
@Excel(name = "仓库")
|
||||||
|
private String warehouseId;
|
||||||
|
|
||||||
|
/** 垛型ID */
|
||||||
|
@Excel(name = "垛型ID")
|
||||||
|
private String stackingId;
|
||||||
|
|
||||||
|
/** 备用字段1 */
|
||||||
|
@Excel(name = "备用字段1")
|
||||||
|
private String spare1;
|
||||||
|
|
||||||
|
/** 备用字段2 */
|
||||||
|
@Excel(name = "备用字段2")
|
||||||
|
private String spare2;
|
||||||
|
|
||||||
|
/** 备用字段3 */
|
||||||
|
@Excel(name = "备用字段3")
|
||||||
|
private String spare3;
|
||||||
|
|
||||||
|
/** 备用字段4 */
|
||||||
|
@Excel(name = "备用字段4")
|
||||||
|
private String spare4;
|
||||||
|
|
||||||
|
/** 备用字段5 */
|
||||||
|
@Excel(name = "备用字段5")
|
||||||
|
private String spare5;
|
||||||
|
|
||||||
|
/** 备用字段6 */
|
||||||
|
@Excel(name = "备用字段6")
|
||||||
|
private String spare6;
|
||||||
|
|
||||||
|
public void setStockId(String stockId)
|
||||||
|
{
|
||||||
|
this.stockId = stockId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStockId()
|
||||||
|
{
|
||||||
|
return stockId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCargoSpaceId(String cargoSpaceId)
|
||||||
|
{
|
||||||
|
this.cargoSpaceId = cargoSpaceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCargoSpaceId()
|
||||||
|
{
|
||||||
|
return cargoSpaceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStockStatus(String stockStatus)
|
||||||
|
{
|
||||||
|
this.stockStatus = stockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStockStatus()
|
||||||
|
{
|
||||||
|
return stockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductStatus(String productStatus)
|
||||||
|
{
|
||||||
|
this.productStatus = productStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductStatus()
|
||||||
|
{
|
||||||
|
return productStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLotNo(String lotNo)
|
||||||
|
{
|
||||||
|
this.lotNo = lotNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLotNo()
|
||||||
|
{
|
||||||
|
return lotNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInDate(String inDate)
|
||||||
|
{
|
||||||
|
this.inDate = inDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInDate()
|
||||||
|
{
|
||||||
|
return inDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackDate(String backDate)
|
||||||
|
{
|
||||||
|
this.backDate = backDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackDate()
|
||||||
|
{
|
||||||
|
return backDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductGuid(String productGuid)
|
||||||
|
{
|
||||||
|
this.productGuid = productGuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductGuid()
|
||||||
|
{
|
||||||
|
return productGuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuantity(String quantity)
|
||||||
|
{
|
||||||
|
this.quantity = quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuantity()
|
||||||
|
{
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobId(String jobId)
|
||||||
|
{
|
||||||
|
this.jobId = jobId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJobId()
|
||||||
|
{
|
||||||
|
return jobId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrayCode(String trayCode)
|
||||||
|
{
|
||||||
|
this.trayCode = trayCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrayCode()
|
||||||
|
{
|
||||||
|
return trayCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOutQuantity(String outQuantity)
|
||||||
|
{
|
||||||
|
this.outQuantity = outQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOutQuantity()
|
||||||
|
{
|
||||||
|
return outQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStockinDetailId(String stockinDetailId)
|
||||||
|
{
|
||||||
|
this.stockinDetailId = stockinDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStockinDetailId()
|
||||||
|
{
|
||||||
|
return stockinDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStockinId(String stockinId)
|
||||||
|
{
|
||||||
|
this.stockinId = stockinId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStockinId()
|
||||||
|
{
|
||||||
|
return stockinId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInType(String inType)
|
||||||
|
{
|
||||||
|
this.inType = inType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInType()
|
||||||
|
{
|
||||||
|
return inType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInClassId(String inClassId)
|
||||||
|
{
|
||||||
|
this.inClassId = inClassId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInClassId()
|
||||||
|
{
|
||||||
|
return inClassId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarehouseId(String warehouseId)
|
||||||
|
{
|
||||||
|
this.warehouseId = warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarehouseId()
|
||||||
|
{
|
||||||
|
return warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStackingId(String stackingId)
|
||||||
|
{
|
||||||
|
this.stackingId = stackingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStackingId()
|
||||||
|
{
|
||||||
|
return stackingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare1(String spare1)
|
||||||
|
{
|
||||||
|
this.spare1 = spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare1()
|
||||||
|
{
|
||||||
|
return spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare2(String spare2)
|
||||||
|
{
|
||||||
|
this.spare2 = spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare2()
|
||||||
|
{
|
||||||
|
return spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare3(String spare3)
|
||||||
|
{
|
||||||
|
this.spare3 = spare3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare3()
|
||||||
|
{
|
||||||
|
return spare3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare4(String spare4)
|
||||||
|
{
|
||||||
|
this.spare4 = spare4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare4()
|
||||||
|
{
|
||||||
|
return spare4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare5(String spare5)
|
||||||
|
{
|
||||||
|
this.spare5 = spare5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare5()
|
||||||
|
{
|
||||||
|
return spare5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare6(String spare6)
|
||||||
|
{
|
||||||
|
this.spare6 = spare6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare6()
|
||||||
|
{
|
||||||
|
return spare6;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("stockId", getStockId())
|
||||||
|
.append("cargoSpaceId", getCargoSpaceId())
|
||||||
|
.append("stockStatus", getStockStatus())
|
||||||
|
.append("productStatus", getProductStatus())
|
||||||
|
.append("lotNo", getLotNo())
|
||||||
|
.append("inDate", getInDate())
|
||||||
|
.append("backDate", getBackDate())
|
||||||
|
.append("productGuid", getProductGuid())
|
||||||
|
.append("quantity", getQuantity())
|
||||||
|
.append("jobId", getJobId())
|
||||||
|
.append("trayCode", getTrayCode())
|
||||||
|
.append("outQuantity", getOutQuantity())
|
||||||
|
.append("stockinDetailId", getStockinDetailId())
|
||||||
|
.append("stockinId", getStockinId())
|
||||||
|
.append("inType", getInType())
|
||||||
|
.append("inClassId", getInClassId())
|
||||||
|
.append("warehouseId", getWarehouseId())
|
||||||
|
.append("stackingId", getStackingId())
|
||||||
|
.append("spare1", getSpare1())
|
||||||
|
.append("spare2", getSpare2())
|
||||||
|
.append("spare3", getSpare3())
|
||||||
|
.append("spare4", getSpare4())
|
||||||
|
.append("spare5", getSpare5())
|
||||||
|
.append("spare6", getSpare6())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.stock.stock.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.stock.stock.domain.BasStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-24
|
||||||
|
*/
|
||||||
|
public interface BasStockMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询库存信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 库存信息
|
||||||
|
*/
|
||||||
|
public BasStock selectBasStockByStockId(String stockId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息列表
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 库存信息集合
|
||||||
|
*/
|
||||||
|
public List<BasStock> selectBasStockList(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBasStock(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBasStock(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除库存信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBasStockByStockId(String stockId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除库存信息
|
||||||
|
*
|
||||||
|
* @param stockIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBasStockByStockIds(String[] stockIds);
|
||||||
|
|
||||||
|
void insertBasStockList(List<BasStock> list);
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.stock.stock.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.stock.stock.domain.BasStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存信息Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-24
|
||||||
|
*/
|
||||||
|
public interface IBasStockService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询库存信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 库存信息
|
||||||
|
*/
|
||||||
|
public BasStock selectBasStockByStockId(String stockId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息列表
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 库存信息集合
|
||||||
|
*/
|
||||||
|
public List<BasStock> selectBasStockList(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBasStock(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBasStock(BasStock basStock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除库存信息
|
||||||
|
*
|
||||||
|
* @param stockIds 需要删除的库存信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBasStockByStockIds(String[] stockIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除库存信息信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBasStockByStockId(String stockId);
|
||||||
|
|
||||||
|
void insertBasStockList(List<BasStock> list);
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.stock.stock.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.stock.stock.mapper.BasStockMapper;
|
||||||
|
import com.ruoyi.stock.stock.domain.BasStock;
|
||||||
|
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BasStockServiceImpl implements IBasStockService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BasStockMapper basStockMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 库存信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BasStock selectBasStockByStockId(String stockId)
|
||||||
|
{
|
||||||
|
return basStockMapper.selectBasStockByStockId(stockId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息列表
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 库存信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BasStock> selectBasStockList(BasStock basStock)
|
||||||
|
{
|
||||||
|
return basStockMapper.selectBasStockList(basStock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBasStock(BasStock basStock)
|
||||||
|
{
|
||||||
|
return basStockMapper.insertBasStock(basStock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改库存信息
|
||||||
|
*
|
||||||
|
* @param basStock 库存信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBasStock(BasStock basStock)
|
||||||
|
{
|
||||||
|
return basStockMapper.updateBasStock(basStock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除库存信息
|
||||||
|
*
|
||||||
|
* @param stockIds 需要删除的库存信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBasStockByStockIds(String[] stockIds)
|
||||||
|
{
|
||||||
|
return basStockMapper.deleteBasStockByStockIds(stockIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除库存信息信息
|
||||||
|
*
|
||||||
|
* @param stockId 库存信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBasStockByStockId(String stockId)
|
||||||
|
{
|
||||||
|
return basStockMapper.deleteBasStockByStockId(stockId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertBasStockList(List<BasStock> list) {
|
||||||
|
basStockMapper.insertBasStockList(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -133,6 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="spare4 != null">#{spare4},</if>
|
<if test="spare4 != null">#{spare4},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertHistory">
|
||||||
|
insert into mydo_job_detail_finish select * from mydo_job_detail where job_id = #{jobId}
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateMydoJobDetail" parameterType="MydoJobDetail">
|
<update id="updateMydoJobDetail" parameterType="MydoJobDetail">
|
||||||
update mydo_job_detail
|
update mydo_job_detail
|
||||||
@@ -176,4 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{jobDetailId}
|
#{jobDetailId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteMydoJobDetailByJobId">
|
||||||
|
delete from mydo_job_detail where job_id = #{jobId}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -128,6 +128,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="faultFlag != null">#{faultFlag},</if>
|
<if test="faultFlag != null">#{faultFlag},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertHistory">
|
||||||
|
insert into mydo_job_finish
|
||||||
|
select * from mydo_job where job_id = #{jobId}
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateMydoJob" parameterType="MydoJob">
|
<update id="updateMydoJob" parameterType="MydoJob">
|
||||||
update mydo_job
|
update mydo_job
|
||||||
|
|||||||
227
ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml
Normal file
227
ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
<?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.stock.stock.mapper.BasStockMapper">
|
||||||
|
|
||||||
|
<resultMap type="BasStock" id="BasStockResult">
|
||||||
|
<result property="stockId" column="stock_id" />
|
||||||
|
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||||
|
<result property="stockStatus" column="stock_status" />
|
||||||
|
<result property="productStatus" column="product_status" />
|
||||||
|
<result property="lotNo" column="lot_no" />
|
||||||
|
<result property="inDate" column="in_date" />
|
||||||
|
<result property="backDate" column="back_date" />
|
||||||
|
<result property="productGuid" column="product_guid" />
|
||||||
|
<result property="quantity" column="quantity" />
|
||||||
|
<result property="jobId" column="job_id" />
|
||||||
|
<result property="trayCode" column="tray_code" />
|
||||||
|
<result property="outQuantity" column="out_quantity" />
|
||||||
|
<result property="stockinDetailId" column="stockin_detail_id" />
|
||||||
|
<result property="stockinId" column="stockin_id" />
|
||||||
|
<result property="inType" column="in_type" />
|
||||||
|
<result property="inClassId" column="in_class_id" />
|
||||||
|
<result property="warehouseId" column="warehouse_id" />
|
||||||
|
<result property="stackingId" column="stacking_id" />
|
||||||
|
<result property="spare1" column="spare1" />
|
||||||
|
<result property="spare2" column="spare2" />
|
||||||
|
<result property="spare3" column="spare3" />
|
||||||
|
<result property="spare4" column="spare4" />
|
||||||
|
<result property="spare5" column="spare5" />
|
||||||
|
<result property="spare6" column="spare6" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBasStockVo">
|
||||||
|
select stock_id, cargo_space_id, stock_status, product_status, lot_no, in_date, back_date, product_guid, quantity, job_id, tray_code, out_quantity, stockin_detail_id, stockin_id, in_type, in_class_id, warehouse_id, stacking_id, spare1, spare2, spare3, spare4, spare5, spare6 from bas_stock
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBasStockList" parameterType="BasStock" resultMap="BasStockResult">
|
||||||
|
<include refid="selectBasStockVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
||||||
|
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||||
|
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
|
||||||
|
<if test="productStatus != null and productStatus != ''"> and product_status = #{productStatus}</if>
|
||||||
|
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
|
||||||
|
<if test="inDate != null and inDate != ''"> and in_date = #{inDate}</if>
|
||||||
|
<if test="backDate != null and backDate != ''"> and back_date = #{backDate}</if>
|
||||||
|
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||||
|
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
|
||||||
|
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||||
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||||
|
<if test="outQuantity != null and outQuantity != ''"> and out_quantity = #{outQuantity}</if>
|
||||||
|
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id = #{stockinDetailId}</if>
|
||||||
|
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
|
||||||
|
<if test="inType != null and inType != ''"> and in_type = #{inType}</if>
|
||||||
|
<if test="inClassId != null and inClassId != ''"> and in_class_id = #{inClassId}</if>
|
||||||
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
|
<if test="stackingId != null and stackingId != ''"> and stacking_id = #{stackingId}</if>
|
||||||
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||||
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||||
|
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||||
|
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
||||||
|
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
||||||
|
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBasStockByStockId" parameterType="String" resultMap="BasStockResult">
|
||||||
|
<include refid="selectBasStockVo"/>
|
||||||
|
where stock_id = #{stockId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBasStock" parameterType="BasStock">
|
||||||
|
insert into bas_stock
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockId != null and stockId != ''">stock_id,</if>
|
||||||
|
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||||
|
<if test="stockStatus != null">stock_status,</if>
|
||||||
|
<if test="productStatus != null">product_status,</if>
|
||||||
|
<if test="lotNo != null">lot_no,</if>
|
||||||
|
<if test="inDate != null">in_date,</if>
|
||||||
|
<if test="backDate != null">back_date,</if>
|
||||||
|
<if test="productGuid != null">product_guid,</if>
|
||||||
|
<if test="quantity != null">quantity,</if>
|
||||||
|
<if test="jobId != null">job_id,</if>
|
||||||
|
<if test="trayCode != null">tray_code,</if>
|
||||||
|
<if test="outQuantity != null">out_quantity,</if>
|
||||||
|
<if test="stockinDetailId != null">stockin_detail_id,</if>
|
||||||
|
<if test="stockinId != null">stockin_id,</if>
|
||||||
|
<if test="inType != null">in_type,</if>
|
||||||
|
<if test="inClassId != null">in_class_id,</if>
|
||||||
|
<if test="warehouseId != null">warehouse_id,</if>
|
||||||
|
<if test="stackingId != null">stacking_id,</if>
|
||||||
|
<if test="spare1 != null">spare1,</if>
|
||||||
|
<if test="spare2 != null">spare2,</if>
|
||||||
|
<if test="spare3 != null">spare3,</if>
|
||||||
|
<if test="spare4 != null">spare4,</if>
|
||||||
|
<if test="spare5 != null">spare5,</if>
|
||||||
|
<if test="spare6 != null">spare6,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockId != null and stockId != ''">#{stockId},</if>
|
||||||
|
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||||
|
<if test="stockStatus != null">#{stockStatus},</if>
|
||||||
|
<if test="productStatus != null">#{productStatus},</if>
|
||||||
|
<if test="lotNo != null">#{lotNo},</if>
|
||||||
|
<if test="inDate != null">#{inDate},</if>
|
||||||
|
<if test="backDate != null">#{backDate},</if>
|
||||||
|
<if test="productGuid != null">#{productGuid},</if>
|
||||||
|
<if test="quantity != null">#{quantity},</if>
|
||||||
|
<if test="jobId != null">#{jobId},</if>
|
||||||
|
<if test="trayCode != null">#{trayCode},</if>
|
||||||
|
<if test="outQuantity != null">#{outQuantity},</if>
|
||||||
|
<if test="stockinDetailId != null">#{stockinDetailId},</if>
|
||||||
|
<if test="stockinId != null">#{stockinId},</if>
|
||||||
|
<if test="inType != null">#{inType},</if>
|
||||||
|
<if test="inClassId != null">#{inClassId},</if>
|
||||||
|
<if test="warehouseId != null">#{warehouseId},</if>
|
||||||
|
<if test="stackingId != null">#{stackingId},</if>
|
||||||
|
<if test="spare1 != null">#{spare1},</if>
|
||||||
|
<if test="spare2 != null">#{spare2},</if>
|
||||||
|
<if test="spare3 != null">#{spare3},</if>
|
||||||
|
<if test="spare4 != null">#{spare4},</if>
|
||||||
|
<if test="spare5 != null">#{spare5},</if>
|
||||||
|
<if test="spare6 != null">#{spare6},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="insertBasStockList">
|
||||||
|
INSERT INTO bas_stock
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="list[0].stockId != null and list[0].stockId != ''">stock_id,</if>
|
||||||
|
<if test="list[0].cargoSpaceId != null">cargo_space_id,</if>
|
||||||
|
<if test="list[0].stockStatus != null">stock_status,</if>
|
||||||
|
<if test="list[0].productStatus != null">product_status,</if>
|
||||||
|
<if test="list[0].lotNo != null">lot_no,</if>
|
||||||
|
<if test="list[0].inDate != null">in_date,</if>
|
||||||
|
<if test="list[0].backDate != null">back_date,</if>
|
||||||
|
<if test="list[0].productGuid != null">product_guid,</if>
|
||||||
|
<if test="list[0].quantity != null">quantity,</if>
|
||||||
|
<if test="list[0].jobId != null">job_id,</if>
|
||||||
|
<if test="list[0].trayCode != null">tray_code,</if>
|
||||||
|
<if test="list[0].outQuantity != null">out_quantity,</if>
|
||||||
|
<if test="list[0].stockinDetailId != null">stockin_detail_id,</if>
|
||||||
|
<if test="list[0].stockinId != null">stockin_id,</if>
|
||||||
|
<if test="list[0].inType != null">in_type,</if>
|
||||||
|
<if test="list[0].inClassId != null">in_class_id,</if>
|
||||||
|
<if test="list[0].warehouseId != null">warehouse_id,</if>
|
||||||
|
<if test="list[0].stackingId != null">stacking_id,</if>
|
||||||
|
<if test="list[0].spare1 != null">spare1,</if>
|
||||||
|
<if test="list[0].spare2 != null">spare2,</if>
|
||||||
|
<if test="list[0].spare3 != null">spare3,</if>
|
||||||
|
<if test="list[0].spare4 != null">spare4,</if>
|
||||||
|
<if test="list[0].spare5 != null">spare5,</if>
|
||||||
|
<if test="list[0].spare6 != null">spare6,</if>
|
||||||
|
</trim>
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="item.stockId != null and item.stockId != ''">#{item.stockId},</if>
|
||||||
|
<if test="item.cargoSpaceId != null">#{item.cargoSpaceId},</if>
|
||||||
|
<if test="item.stockStatus != null">#{item.stockStatus},</if>
|
||||||
|
<if test="item.productStatus != null">#{item.productStatus},</if>
|
||||||
|
<if test="item.lotNo != null">#{item.lotNo},</if>
|
||||||
|
<if test="item.inDate != null">#{item.inDate},</if>
|
||||||
|
<if test="item.backDate != null">#{item.backDate},</if>
|
||||||
|
<if test="item.productGuid != null">#{item.productGuid},</if>
|
||||||
|
<if test="item.quantity != null">#{item.quantity},</if>
|
||||||
|
<if test="item.jobId != null">#{item.jobId},</if>
|
||||||
|
<if test="item.trayCode != null">#{item.trayCode},</if>
|
||||||
|
<if test="item.outQuantity != null">#{item.outQuantity},</if>
|
||||||
|
<if test="item.stockinDetailId != null">#{item.stockinDetailId},</if>
|
||||||
|
<if test="item.stockinId != null">#{item.stockinId},</if>
|
||||||
|
<if test="item.inType != null">#{item.inType},</if>
|
||||||
|
<if test="item.inClassId != null">#{item.inClassId},</if>
|
||||||
|
<if test="item.warehouseId != null">#{item.warehouseId},</if>
|
||||||
|
<if test="item.stackingId != null">#{item.stackingId},</if>
|
||||||
|
<if test="item.spare1 != null">#{item.spare1},</if>
|
||||||
|
<if test="item.spare2 != null">#{item.spare2},</if>
|
||||||
|
<if test="item.spare3 != null">#{item.spare3},</if>
|
||||||
|
<if test="item.spare4 != null">#{item.spare4},</if>
|
||||||
|
<if test="item.spare5 != null">#{item.spare5},</if>
|
||||||
|
<if test="item.spare6 != null">#{item.spare6},</if>
|
||||||
|
</trim>
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBasStock" parameterType="BasStock">
|
||||||
|
update bas_stock
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||||
|
<if test="stockStatus != null">stock_status = #{stockStatus},</if>
|
||||||
|
<if test="productStatus != null">product_status = #{productStatus},</if>
|
||||||
|
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
||||||
|
<if test="inDate != null">in_date = #{inDate},</if>
|
||||||
|
<if test="backDate != null">back_date = #{backDate},</if>
|
||||||
|
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
||||||
|
<if test="quantity != null">quantity = #{quantity},</if>
|
||||||
|
<if test="jobId != null">job_id = #{jobId},</if>
|
||||||
|
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||||
|
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
|
||||||
|
<if test="stockinDetailId != null">stockin_detail_id = #{stockinDetailId},</if>
|
||||||
|
<if test="stockinId != null">stockin_id = #{stockinId},</if>
|
||||||
|
<if test="inType != null">in_type = #{inType},</if>
|
||||||
|
<if test="inClassId != null">in_class_id = #{inClassId},</if>
|
||||||
|
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||||
|
<if test="stackingId != null">stacking_id = #{stackingId},</if>
|
||||||
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||||
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||||
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||||
|
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||||
|
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||||
|
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||||
|
</trim>
|
||||||
|
where stock_id = #{stockId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBasStockByStockId" parameterType="String">
|
||||||
|
delete from bas_stock where stock_id = #{stockId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBasStockByStockIds" parameterType="String">
|
||||||
|
delete from bas_stock where stock_id in
|
||||||
|
<foreach item="stockId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{stockId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
44
ruoyi-ui/src/api/stock/management.js
Normal file
44
ruoyi-ui/src/api/stock/management.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询库存信息列表
|
||||||
|
export function listManagement(query) {
|
||||||
|
return request({
|
||||||
|
url: '/stock/management/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询库存信息详细
|
||||||
|
export function getManagement(stockId) {
|
||||||
|
return request({
|
||||||
|
url: '/stock/management/' + stockId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增库存信息
|
||||||
|
export function addManagement(data) {
|
||||||
|
return request({
|
||||||
|
url: '/stock/management',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改库存信息
|
||||||
|
export function updateManagement(data) {
|
||||||
|
return request({
|
||||||
|
url: '/stock/management',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除库存信息
|
||||||
|
export function delManagement(stockId) {
|
||||||
|
return request({
|
||||||
|
url: '/stock/management/' + stockId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -208,17 +208,27 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
@click="handleCompletedManually({type: 'invalid'})"
|
||||||
|
v-hasPermi="['job:mydoJob:CompletedManually']"
|
||||||
|
>手动作废</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleCompletedManually"
|
@click="handleCompletedManually({type: 'completed'})"
|
||||||
v-hasPermi="['job:mydoJob:CompletedManually']"
|
v-hasPermi="['job:mydoJob:CompletedManually']"
|
||||||
>手动完成</el-button>
|
>手动完成</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@@ -227,13 +237,14 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['job:mydoJob:export']"
|
v-hasPermi="['job:mydoJob:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange" @row-click="handleRowClick" highlight-current-row :current-row="currentRow">
|
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange" @row-click="handleRowClick" highlight-current-row :current-row="currentRow"
|
||||||
|
max-height="300">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
<el-table-column label="任务ID" align="center" prop="jobId" fixed />
|
||||||
<el-table-column label="任务状态" align="center" prop="status">
|
<el-table-column label="任务状态" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
||||||
@@ -292,7 +303,9 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange">
|
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange"
|
||||||
|
max-height="300"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="子任务ID" align="center" prop="jobDetailId" />
|
<el-table-column label="子任务ID" align="center" prop="jobDetailId" />
|
||||||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
<el-table-column label="任务ID" align="center" prop="jobId" />
|
||||||
@@ -482,14 +495,39 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm")
|
this.resetForm("queryForm");
|
||||||
this.handleQuery()
|
// 清空子表数据
|
||||||
|
this.mydoJobDetailList = [];
|
||||||
|
this.detailTotal = 0;
|
||||||
|
this.currentRow = null;
|
||||||
|
this.queryDetailParams.jobId = null;
|
||||||
|
// 重新查询主表数据
|
||||||
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.jobId)
|
// 只处理主表的多选
|
||||||
this.single = selection.length!==1
|
if (selection.length > 0 && selection[0].hasOwnProperty('jobDetailId')) {
|
||||||
this.multiple = !selection.length
|
return;
|
||||||
|
}
|
||||||
|
this.ids = selection.map(item => item.jobId);
|
||||||
|
this.single = selection.length!==1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手动完成/作废
|
||||||
|
handleCompletedManually(row) {
|
||||||
|
const jobIds = this.ids;
|
||||||
|
if (jobIds.length === 0) {
|
||||||
|
this.$modal.msgError("请选择要操作的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (row.type === 'invalid'){
|
||||||
|
//手动作废
|
||||||
|
}else if (row.type === 'completed'){
|
||||||
|
//手动完成
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
@@ -522,10 +560,6 @@ export default {
|
|||||||
this.detailLoading = false;
|
this.detailLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//手动完成
|
|
||||||
handleCompletedManually(row){
|
|
||||||
const stockinDetailIds = row.stockinDetailId || this.detailIds
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
v-hasPermi="['receive:stockin:export']"
|
v-hasPermi="['receive:stockin:export']"
|
||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
>单据确认
|
>单据确认
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
v-hasPermi="['in:stockIn:export']"
|
v-hasPermi="['in:stockIn:export']"
|
||||||
>单据导出
|
>单据导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="info"
|
type="info"
|
||||||
|
|||||||
584
ruoyi-ui/src/views/stock/management/index.vue
Normal file
584
ruoyi-ui/src/views/stock/management/index.vue
Normal file
@@ -0,0 +1,584 @@
|
|||||||
|
<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="库存id" prop="stockId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.stockId"
|
||||||
|
placeholder="请输入库存id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="货位id" prop="cargoSpaceId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.cargoSpaceId"
|
||||||
|
placeholder="请输入货位id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存状态" prop="stockStatus">
|
||||||
|
<el-select v-model="queryParams.stockStatus" placeholder="请选择库存状态" 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="物料状态" prop="productStatus">
|
||||||
|
<el-select v-model="queryParams.productStatus" placeholder="请选择物料状态" 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="批次号" prop="lotNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.lotNo"
|
||||||
|
placeholder="请输入批次号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库时间" prop="inDate">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.inDate"
|
||||||
|
placeholder="请输入入库时间"
|
||||||
|
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="托盘条码" prop="trayCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.trayCode"
|
||||||
|
placeholder="请输入托盘条码"
|
||||||
|
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="仓库" prop="warehouseId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.warehouseId"
|
||||||
|
placeholder="请输入仓库"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="垛型ID" prop="stackingId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.stackingId"
|
||||||
|
placeholder="请输入垛型ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</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">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['stock:management: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']"
|
||||||
|
>修改</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']"
|
||||||
|
>删除</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']"
|
||||||
|
>导出</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="库存id" align="center" prop="stockId" />
|
||||||
|
<el-table-column label="货位id" align="center" prop="cargoSpaceId" />
|
||||||
|
<el-table-column label="库存状态" align="center" prop="stockStatus">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料状态" 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="批次号" align="center" prop="lotNo" />
|
||||||
|
<el-table-column label="入库时间" align="center" prop="inDate" />
|
||||||
|
<el-table-column label="回流时间" align="center" prop="backDate" />
|
||||||
|
<el-table-column label="物料GUID" align="center" prop="productGuid" />
|
||||||
|
<el-table-column label="库存数量" align="center" prop="quantity" />
|
||||||
|
<el-table-column label="作业ID" align="center" prop="jobId" />
|
||||||
|
<el-table-column label="托盘条码" align="center" prop="trayCode" />
|
||||||
|
<el-table-column label="出库数量" align="center" prop="outQuantity" />
|
||||||
|
<el-table-column label="入库子单id" align="center" prop="stockinDetailId" />
|
||||||
|
<el-table-column label="入库主单" align="center" prop="stockinId" />
|
||||||
|
<el-table-column label="入库类型" align="center" prop="inType" />
|
||||||
|
<el-table-column label="入库班组ID" align="center" prop="inClassId" />
|
||||||
|
<el-table-column label="仓库" align="center" prop="warehouseId" />
|
||||||
|
<el-table-column label="垛型ID" align="center" prop="stackingId" />
|
||||||
|
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||||
|
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||||
|
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||||
|
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
||||||
|
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
||||||
|
<el-table-column label="备用字段6" align="center" prop="spare6" />-->
|
||||||
|
<el-table-column label="操作" 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']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['stock:management:remove']"
|
||||||
|
>删除</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="库存id" prop="stockId">
|
||||||
|
<el-input v-model="form.stockId" placeholder="请输入库存id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="货位id" prop="cargoSpaceId">
|
||||||
|
<el-input v-model="form.cargoSpaceId" placeholder="请输入货位id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存状态" prop="stockStatus">
|
||||||
|
<el-select v-model="form.stockStatus" placeholder="请选择库存状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.stock_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料状态" prop="productStatus">
|
||||||
|
<el-select v-model="form.productStatus" placeholder="请选择物料状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.product_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次号" prop="lotNo">
|
||||||
|
<el-input v-model="form.lotNo" placeholder="请输入批次号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库时间" prop="inDate">
|
||||||
|
<el-input v-model="form.inDate" placeholder="请输入入库时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="回流时间" prop="backDate">
|
||||||
|
<el-input v-model="form.backDate" placeholder="请输入回流时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料GUID" prop="productGuid">
|
||||||
|
<el-input v-model="form.productGuid" placeholder="请输入物料GUID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存数量" prop="quantity">
|
||||||
|
<el-input v-model="form.quantity" placeholder="请输入库存数量" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="作业ID" prop="jobId">
|
||||||
|
<el-input v-model="form.jobId" placeholder="请输入作业ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="托盘条码" prop="trayCode">
|
||||||
|
<el-input v-model="form.trayCode" placeholder="请输入托盘条码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出库数量" prop="outQuantity">
|
||||||
|
<el-input v-model="form.outQuantity" placeholder="请输入出库数量" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库子单id" prop="stockinDetailId">
|
||||||
|
<el-input v-model="form.stockinDetailId" placeholder="请输入入库子单id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库主单" prop="stockinId">
|
||||||
|
<el-input v-model="form.stockinId" placeholder="请输入入库主单" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库班组ID" prop="inClassId">
|
||||||
|
<el-input v-model="form.inClassId" placeholder="请输入入库班组ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
|
<el-input v-model="form.warehouseId" placeholder="请输入仓库" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="垛型ID" prop="stackingId">
|
||||||
|
<el-input v-model="form.stackingId" placeholder="请输入垛型ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段1" prop="spare1">
|
||||||
|
<el-input v-model="form.spare1" placeholder="请输入备用字段1" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段2" prop="spare2">
|
||||||
|
<el-input v-model="form.spare2" placeholder="请输入备用字段2" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段3" prop="spare3">
|
||||||
|
<el-input v-model="form.spare3" placeholder="请输入备用字段3" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段4" prop="spare4">
|
||||||
|
<el-input v-model="form.spare4" placeholder="请输入备用字段4" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段5" prop="spare5">
|
||||||
|
<el-input v-model="form.spare5" placeholder="请输入备用字段5" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备用字段6" prop="spare6">
|
||||||
|
<el-input v-model="form.spare6" placeholder="请输入备用字段6" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Management",
|
||||||
|
dicts: ['product_status', 'stock_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 库存信息表格数据
|
||||||
|
managementList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
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
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
stockId: [
|
||||||
|
{ required: true, message: "库存id不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询库存信息列表 */
|
||||||
|
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
|
||||||
|
}
|
||||||
|
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 = "添加库存信息"
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const stockId = row.stockId || this.ids
|
||||||
|
getManagement(stockId).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = "修改库存信息"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.stockId != null) {
|
||||||
|
updateManagement(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addManagement(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const stockIds = row.stockId || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除库存信息编号为"' + stockIds + '"的数据项?').then(function() {
|
||||||
|
return delManagement(stockIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess("删除成功")
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('stock/management/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `management_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user