添加入库单据
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.ruoyi.bas.BasProduct.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -7,10 +9,12 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 物料管理对象 bas_product
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BasProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -70,164 +74,9 @@ public class BasProduct extends BaseEntity
|
||||
@Excel(name = "物料名称")
|
||||
private String productName;
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String quantity;
|
||||
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setPrice(String price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setCargoNo(String cargoNo)
|
||||
{
|
||||
this.cargoNo = cargoNo;
|
||||
}
|
||||
|
||||
public String getCargoNo()
|
||||
{
|
||||
return cargoNo;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setSpec(String spec)
|
||||
{
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getSpec()
|
||||
{
|
||||
return spec;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("productGuid", getProductGuid())
|
||||
.append("productId", getProductId())
|
||||
.append("parentId", getParentId())
|
||||
.append("price", getPrice())
|
||||
.append("cargoNo", getCargoNo())
|
||||
.append("unit", getUnit())
|
||||
.append("spec", getSpec())
|
||||
.append("remark", getRemark())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("spare4", getSpare4())
|
||||
.append("spare5", getSpare5())
|
||||
.append("spare6", getSpare6())
|
||||
.append("productName", getProductName())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,19 @@ package com.ruoyi.bas.BasProduct.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 物料管理Mapper接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface BasProductMapper
|
||||
public interface BasProductMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
*/
|
||||
@@ -21,7 +22,7 @@ public interface BasProductMapper
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理集合
|
||||
*/
|
||||
@@ -29,7 +30,7 @@ public interface BasProductMapper
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -37,7 +38,7 @@ public interface BasProductMapper
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +46,7 @@ public interface BasProductMapper
|
||||
|
||||
/**
|
||||
* 删除物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,9 +54,16 @@ public interface BasProductMapper
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuids(String[] productGuids);
|
||||
|
||||
/**
|
||||
* 通过物料id列表批量查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(@Param("productGuids") List<String> collect);
|
||||
}
|
||||
|
||||
@@ -5,15 +5,15 @@ import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
|
||||
/**
|
||||
* 物料管理Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface IBasProductService
|
||||
public interface IBasProductService
|
||||
{
|
||||
/**
|
||||
* 查询物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
*/
|
||||
@@ -21,7 +21,7 @@ public interface IBasProductService
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理集合
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ public interface IBasProductService
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public interface IBasProductService
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public interface IBasProductService
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuids 需要删除的物料管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,9 +53,16 @@ public interface IBasProductService
|
||||
|
||||
/**
|
||||
* 删除物料管理信息
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuid(String productGuid);
|
||||
|
||||
/**
|
||||
* 通过物料id列表查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(List<String> collect);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.ruoyi.bas.BasProduct.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
|
||||
@@ -9,19 +12,19 @@ import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
|
||||
/**
|
||||
* 物料管理Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@Service
|
||||
public class BasProductServiceImpl implements IBasProductService
|
||||
public class BasProductServiceImpl implements IBasProductService
|
||||
{
|
||||
@Autowired
|
||||
private BasProductMapper basProductMapper;
|
||||
|
||||
/**
|
||||
* 查询物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
*/
|
||||
@@ -33,7 +36,7 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理
|
||||
*/
|
||||
@@ -45,7 +48,7 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -57,7 +60,7 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
*
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -69,7 +72,7 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
*
|
||||
*
|
||||
* @param productGuids 需要删除的物料管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -81,7 +84,7 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
|
||||
/**
|
||||
* 删除物料管理信息
|
||||
*
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -90,4 +93,16 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
{
|
||||
return basProductMapper.deleteBasProductByProductGuid(productGuid);
|
||||
}
|
||||
/**
|
||||
* 通过物料id列表查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductListByProductGuids(List<String> collect) {
|
||||
if (CollUtil.isEmpty(collect)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return basProductMapper.selectBasProductListByProductGuids(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
存放入库相关的业务代码和配置文件
|
||||
|
||||
## 主要功能
|
||||
- 处理商品入库业务流程
|
||||
- 处理物料入库业务流程
|
||||
- 管理入库单据信息
|
||||
- 处理入库质检和验收
|
||||
- 入库数据统计和分析
|
||||
@@ -17,4 +17,4 @@ in/
|
||||
├── model/ # 入库数据模型
|
||||
├── service/ # 入库业务逻辑
|
||||
└── utils/ # 入库相关工具类
|
||||
```
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
存放出库相关的业务代码和配置文件
|
||||
|
||||
## 主要功能
|
||||
- 处理商品出库业务流程
|
||||
- 处理物料出库业务流程
|
||||
- 管理出库单据信息
|
||||
- 处理出库复核和交接
|
||||
- 出库数据统计和分析
|
||||
@@ -17,4 +17,4 @@ out/
|
||||
├── model/ # 出库数据模型
|
||||
├── service/ # 出库业务逻辑
|
||||
└── utils/ # 出库相关工具类
|
||||
```
|
||||
```
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.ruoyi.receive.stockin.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveProductVo;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveStockVo;
|
||||
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.receive.stockin.domain.ReceiveStockin;
|
||||
import com.ruoyi.receive.stockin.service.IReceiveStockinService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 收货单据Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/receive/stockin")
|
||||
public class ReceiveStockinController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IReceiveStockinService receiveStockinService;
|
||||
|
||||
/**
|
||||
* 查询收货单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReceiveStockin receiveStockin)
|
||||
{
|
||||
startPage();
|
||||
List<ReceiveStockin> list = receiveStockinService.selectReceiveStockinList(receiveStockin);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出收货单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:export')")
|
||||
@Log(title = "收货单据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ReceiveStockin receiveStockin)
|
||||
{
|
||||
List<ReceiveStockin> list = receiveStockinService.selectReceiveStockinList(receiveStockin);
|
||||
ExcelUtil<ReceiveStockin> util = new ExcelUtil<ReceiveStockin>(ReceiveStockin.class);
|
||||
util.exportExcel(response, list, "收货单据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收货单据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:query')")
|
||||
@GetMapping(value = "/{stockinGuid}")
|
||||
public AjaxResult getInfo(@PathVariable("stockinGuid") String stockinGuid)
|
||||
{
|
||||
return success(receiveStockinService.selectReceiveStockinByStockinGuid(stockinGuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收货单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:add')")
|
||||
@Log(title = "收货单据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ReceiveStockVo receiveStockin)
|
||||
{
|
||||
return receiveStockinService.insertReceiveStockin(receiveStockin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入收货单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:import')")
|
||||
@Log(title = "收货单据", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/analyseExportFile")
|
||||
public AjaxResult analyseExportFile(MultipartFile file) throws IOException {
|
||||
ExcelUtil<ReceiveProductVo> util = new ExcelUtil<ReceiveProductVo>(ReceiveProductVo.class);
|
||||
List<ReceiveProductVo> list = util.importExcel(file.getInputStream());
|
||||
return receiveStockinService.analyseExportFile(list);
|
||||
}
|
||||
/**
|
||||
* 下载收货单据模板
|
||||
*/
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
ExcelUtil<ReceiveProductVo> util = new ExcelUtil<ReceiveProductVo>(ReceiveProductVo.class);
|
||||
util.importTemplateExcel(response, "物料数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收货单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:edit')")
|
||||
@Log(title = "收货单据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ReceiveStockin receiveStockin)
|
||||
{
|
||||
return toAjax(receiveStockinService.updateReceiveStockin(receiveStockin));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收货单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockin:remove')")
|
||||
@Log(title = "收货单据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{stockinGuids}")
|
||||
public AjaxResult remove(@PathVariable String[] stockinGuids)
|
||||
{
|
||||
return toAjax(receiveStockinService.deleteReceiveStockinByStockinGuids(stockinGuids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package com.ruoyi.receive.stockin.domain;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
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;
|
||||
import org.apache.commons.math3.stat.descriptive.summary.Product;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收货单据对象 receive_stockin
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public class ReceiveStockin extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** GUID */
|
||||
private String stockinGuid;
|
||||
|
||||
/** 入库订单ID */
|
||||
@Excel(name = "入库订单ID")
|
||||
private String stockinId;
|
||||
|
||||
/** 入库类型 */
|
||||
@Excel(name = "入库类型")
|
||||
private String inType;
|
||||
|
||||
/** 建立时间 */
|
||||
@Excel(name = "建立时间")
|
||||
private String createDate;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createManId;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private String warehouseId;
|
||||
|
||||
/** 备用字段5 */
|
||||
@Excel(name = "备用字段5")
|
||||
private String spare5;
|
||||
|
||||
/** 备用字段4 */
|
||||
@Excel(name = "备用字段4")
|
||||
private String spare4;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private String spare3;
|
||||
|
||||
/** 完成日期 */
|
||||
@Excel(name = " 完成日期")
|
||||
private String finishDate;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String spare1;
|
||||
|
||||
/** erp单号 */
|
||||
@Excel(name = "erp单号")
|
||||
private String erpBill;
|
||||
|
||||
/** 单据来源 */
|
||||
@Excel(name = "单据来源")
|
||||
private String stockSource;
|
||||
|
||||
/** 部门编码 */
|
||||
@Excel(name = "部门编码")
|
||||
private String departmentNo;
|
||||
|
||||
/** 客户编码 */
|
||||
@Excel(name = "客户编码")
|
||||
private String customerNo;
|
||||
|
||||
/** 班组编码 */
|
||||
@Excel(name = "班组编码")
|
||||
private String classNo;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String supplierNo;
|
||||
|
||||
|
||||
public void setStockinGuid(String stockinGuid)
|
||||
{
|
||||
this.stockinGuid = stockinGuid;
|
||||
}
|
||||
|
||||
public String getStockinGuid()
|
||||
{
|
||||
return stockinGuid;
|
||||
}
|
||||
|
||||
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 setCreateDate(String createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public String getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateManId(String createManId)
|
||||
{
|
||||
this.createManId = createManId;
|
||||
}
|
||||
|
||||
public String getCreateManId()
|
||||
{
|
||||
return createManId;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setSpare5(String spare5)
|
||||
{
|
||||
this.spare5 = spare5;
|
||||
}
|
||||
|
||||
public String getSpare5()
|
||||
{
|
||||
return spare5;
|
||||
}
|
||||
|
||||
public void setSpare4(String spare4)
|
||||
{
|
||||
this.spare4 = spare4;
|
||||
}
|
||||
|
||||
public String getSpare4()
|
||||
{
|
||||
return spare4;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
public void setFinishDate(String finishDate)
|
||||
{
|
||||
this.finishDate = finishDate;
|
||||
}
|
||||
|
||||
public String getFinishDate()
|
||||
{
|
||||
return finishDate;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setErpBill(String erpBill)
|
||||
{
|
||||
this.erpBill = erpBill;
|
||||
}
|
||||
|
||||
public String getErpBill()
|
||||
{
|
||||
return erpBill;
|
||||
}
|
||||
|
||||
public void setStockSource(String stockSource)
|
||||
{
|
||||
this.stockSource = stockSource;
|
||||
}
|
||||
|
||||
public String getStockSource()
|
||||
{
|
||||
return stockSource;
|
||||
}
|
||||
|
||||
public void setDepartmentNo(String departmentNo)
|
||||
{
|
||||
this.departmentNo = departmentNo;
|
||||
}
|
||||
|
||||
public String getDepartmentNo()
|
||||
{
|
||||
return departmentNo;
|
||||
}
|
||||
|
||||
public void setCustomerNo(String customerNo)
|
||||
{
|
||||
this.customerNo = customerNo;
|
||||
}
|
||||
|
||||
public String getCustomerNo()
|
||||
{
|
||||
return customerNo;
|
||||
}
|
||||
|
||||
public void setClassNo(String classNo)
|
||||
{
|
||||
this.classNo = classNo;
|
||||
}
|
||||
|
||||
public String getClassNo()
|
||||
{
|
||||
return classNo;
|
||||
}
|
||||
|
||||
public void setSupplierNo(String supplierNo)
|
||||
{
|
||||
this.supplierNo = supplierNo;
|
||||
}
|
||||
|
||||
public String getSupplierNo()
|
||||
{
|
||||
return supplierNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("stockinGuid", getStockinGuid())
|
||||
.append("stockinId", getStockinId())
|
||||
.append("inType", getInType())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("createManId", getCreateManId())
|
||||
.append("status", getStatus())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("spare5", getSpare5())
|
||||
.append("spare4", getSpare4())
|
||||
.append("spare3", getSpare3())
|
||||
.append("finishDate", getFinishDate())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare1", getSpare1())
|
||||
.append("erpBill", getErpBill())
|
||||
.append("stockSource", getStockSource())
|
||||
.append("departmentNo", getDepartmentNo())
|
||||
.append("customerNo", getCustomerNo())
|
||||
.append("classNo", getClassNo())
|
||||
.append("supplierNo", getSupplierNo())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.receive.stockin.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class ReceiveProductVo {
|
||||
@Excel(name = "物料编码")
|
||||
private String productGuid;
|
||||
@Excel(name = "物料数量")
|
||||
private String quantity;
|
||||
@Excel(name = "批次号")
|
||||
private String lotNo;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.receive.stockin.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class ReceiveStockVo {
|
||||
@NotBlank
|
||||
private String warehouseId;
|
||||
@NotBlank
|
||||
private String supplierId;
|
||||
private String remark;
|
||||
@NotEmpty
|
||||
private List<ReceiveProductVo> productVoList;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.receive.stockin.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.receive.stockin.domain.ReceiveStockin;
|
||||
|
||||
/**
|
||||
* 收货单据Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface ReceiveStockinMapper
|
||||
{
|
||||
/**
|
||||
* 查询收货单据
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 收货单据
|
||||
*/
|
||||
public ReceiveStockin selectReceiveStockinByStockinGuid(String stockinGuid);
|
||||
|
||||
/**
|
||||
* 查询收货单据列表
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 收货单据集合
|
||||
*/
|
||||
public List<ReceiveStockin> selectReceiveStockinList(ReceiveStockin receiveStockin);
|
||||
|
||||
/**
|
||||
* 新增收货单据
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertReceiveStockin(ReceiveStockin receiveStockin);
|
||||
|
||||
/**
|
||||
* 修改收货单据
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReceiveStockin(ReceiveStockin receiveStockin);
|
||||
|
||||
/**
|
||||
* 删除收货单据
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinByStockinGuid(String stockinGuid);
|
||||
|
||||
/**
|
||||
* 批量删除收货单据
|
||||
*
|
||||
* @param stockinGuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinByStockinGuids(String[] stockinGuids);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.receive.stockin.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.receive.stockin.domain.ReceiveStockin;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveProductVo;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveStockVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 收货单据Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface IReceiveStockinService
|
||||
{
|
||||
/**
|
||||
* 查询收货单据
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 收货单据
|
||||
*/
|
||||
public ReceiveStockin selectReceiveStockinByStockinGuid(String stockinGuid);
|
||||
|
||||
/**
|
||||
* 查询收货单据列表
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 收货单据集合
|
||||
*/
|
||||
public List<ReceiveStockin> selectReceiveStockinList(ReceiveStockin receiveStockin);
|
||||
|
||||
/**
|
||||
* 新增收货单据
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult insertReceiveStockin(ReceiveStockVo receiveStockin);
|
||||
|
||||
/**
|
||||
* 修改收货单据
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReceiveStockin(ReceiveStockin receiveStockin);
|
||||
|
||||
/**
|
||||
* 批量删除收货单据
|
||||
*
|
||||
* @param stockinGuids 需要删除的收货单据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinByStockinGuids(String[] stockinGuids);
|
||||
|
||||
/**
|
||||
* 删除收货单据信息
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinByStockinGuid(String stockinGuid);
|
||||
|
||||
/**
|
||||
* 解析导入文件物料数据
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
AjaxResult analyseExportFile(List<ReceiveProductVo> list );
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.ruoyi.receive.stockin.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.Hutool;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveProductVo;
|
||||
import com.ruoyi.receive.stockin.domain.vo.ReceiveStockVo;
|
||||
import com.ruoyi.receive.stockindetail.domain.ReceiveStockinDetail;
|
||||
import com.ruoyi.receive.stockindetail.service.IReceiveStockinDetailService;
|
||||
import com.ruoyi.receive.stockindetail.service.impl.ReceiveStockinDetailServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.receive.stockin.mapper.ReceiveStockinMapper;
|
||||
import com.ruoyi.receive.stockin.domain.ReceiveStockin;
|
||||
import com.ruoyi.receive.stockin.service.IReceiveStockinService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 收货单据Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@Service
|
||||
public class ReceiveStockinServiceImpl implements IReceiveStockinService
|
||||
{
|
||||
@Autowired
|
||||
private ReceiveStockinMapper receiveStockinMapper;
|
||||
@Autowired
|
||||
private IReceiveStockinDetailService iReceiveStockinDetailService;
|
||||
@Autowired
|
||||
private IBasProductService iBasProductService;
|
||||
|
||||
/**
|
||||
* 查询收货单据
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 收货单据
|
||||
*/
|
||||
@Override
|
||||
public ReceiveStockin selectReceiveStockinByStockinGuid(String stockinGuid)
|
||||
{
|
||||
return receiveStockinMapper.selectReceiveStockinByStockinGuid(stockinGuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询收货单据列表
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 收货单据
|
||||
*/
|
||||
@Override
|
||||
public List<ReceiveStockin> selectReceiveStockinList(ReceiveStockin receiveStockin)
|
||||
{
|
||||
return receiveStockinMapper.selectReceiveStockinList(receiveStockin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收货单据
|
||||
*
|
||||
* @param receiveStockVo 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult insertReceiveStockin(ReceiveStockVo receiveStockVo)
|
||||
{
|
||||
List<ReceiveProductVo> productVoList = receiveStockVo.getProductVoList();
|
||||
if (CollUtil.isEmpty(productVoList)){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
ReceiveStockin receiveStockin = new ReceiveStockin();
|
||||
receiveStockin.setStockinGuid(IdUtil.fastSimpleUUID());
|
||||
receiveStockin.setSupplierNo(receiveStockVo.getSupplierId());
|
||||
receiveStockin.setWarehouseId(receiveStockVo.getWarehouseId());
|
||||
receiveStockin.setCreateDate(DateUtil.format(DateUtil.date(),"yyyy-MM-dd HH:mm:ss"));
|
||||
receiveStockin.setInType("1");
|
||||
receiveStockin.setStockSource("1");
|
||||
//receiveStockin.setSpare1(receiveStockVo.getBatchId());
|
||||
receiveStockin.setCreateManId(Convert.toStr(SecurityUtils.getUserId()));
|
||||
receiveStockin.setStockinId(IdUtil.fastSimpleUUID());
|
||||
receiveStockin.setStatus("0");
|
||||
receiveStockinMapper.insertReceiveStockin(receiveStockin);
|
||||
for (ReceiveProductVo receiveProductVo : productVoList) {
|
||||
BasProduct basProduct = iBasProductService.selectBasProductByProductGuid(receiveProductVo.getProductGuid());
|
||||
ReceiveStockinDetail receiveStockinDetail = new ReceiveStockinDetail();
|
||||
receiveStockinDetail.setQuantity(receiveProductVo.getQuantity());
|
||||
receiveStockinDetail.setProductGuid(receiveProductVo.getProductGuid());
|
||||
receiveStockinDetail.setProductId(basProduct.getProductId());
|
||||
receiveStockinDetail.setStockinGuid(receiveStockin.getStockinGuid());
|
||||
receiveStockinDetail.setStockinId(receiveStockin.getStockinId());
|
||||
receiveStockinDetail.setStockinDetailId(IdUtil.fastSimpleUUID());
|
||||
receiveStockinDetail.setUnit(basProduct.getUnit());
|
||||
receiveStockinDetail.setSpec(basProduct.getSpec());
|
||||
receiveStockinDetail.setSpare1(basProduct.getSpare1());
|
||||
receiveStockinDetail.setSpare2(basProduct.getSpare2());
|
||||
receiveStockinDetail.setSpare3(basProduct.getSpare3());
|
||||
receiveStockinDetail.setSpare4(basProduct.getSpare4());
|
||||
receiveStockinDetail.setSpare5(basProduct.getSpare5());
|
||||
receiveStockinDetail.setSpare6(basProduct.getSpare6());
|
||||
receiveStockinDetail.setCargoNo(basProduct.getCargoNo());
|
||||
receiveStockinDetail.setPrice(basProduct.getPrice());
|
||||
receiveStockinDetail.setRemark(basProduct.getRemark());
|
||||
receiveStockinDetail.setStockStatus("0");
|
||||
receiveStockinDetail.setLotNo(receiveProductVo.getLotNo());
|
||||
iReceiveStockinDetailService.insertReceiveStockinDetail(receiveStockinDetail);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收货单据
|
||||
*
|
||||
* @param receiveStockin 收货单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateReceiveStockin(ReceiveStockin receiveStockin)
|
||||
{
|
||||
return receiveStockinMapper.updateReceiveStockin(receiveStockin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除收货单据
|
||||
*
|
||||
* @param stockinGuids 需要删除的收货单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteReceiveStockinByStockinGuids(String[] stockinGuids)
|
||||
{
|
||||
return receiveStockinMapper.deleteReceiveStockinByStockinGuids(stockinGuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收货单据信息
|
||||
*
|
||||
* @param stockinGuid 收货单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteReceiveStockinByStockinGuid(String stockinGuid)
|
||||
{
|
||||
return receiveStockinMapper.deleteReceiveStockinByStockinGuid(stockinGuid);
|
||||
}
|
||||
/**
|
||||
* 解析导入文件物料数据
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult analyseExportFile(List<ReceiveProductVo> list) {
|
||||
if (CollUtil.isEmpty(list)){
|
||||
return AjaxResult.error("导入数据为空");
|
||||
}
|
||||
List<String> collect = list.stream().map(ReceiveProductVo::getProductGuid).collect(Collectors.toList());
|
||||
List<BasProduct> result = iBasProductService.selectBasProductListByProductGuids(collect);
|
||||
for (BasProduct basProduct : result) {
|
||||
Optional<ReceiveProductVo> first = list.stream().filter(x -> x.getProductGuid().equals(basProduct.getProductGuid())).findFirst();
|
||||
first.ifPresent(receiveProductVo -> basProduct.setQuantity(receiveProductVo.getQuantity()));
|
||||
}
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.receive.stockindetail.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.receive.stockindetail.domain.ReceiveStockinDetail;
|
||||
import com.ruoyi.receive.stockindetail.service.IReceiveStockinDetailService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 收货单据子单Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/receive/stockInDetail")
|
||||
public class ReceiveStockinDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IReceiveStockinDetailService receiveStockinDetailService;
|
||||
|
||||
/**
|
||||
* 查询收货单据子单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
startPage();
|
||||
List<ReceiveStockinDetail> list = receiveStockinDetailService.selectReceiveStockinDetailList(receiveStockinDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出收货单据子单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:export')")
|
||||
@Log(title = "收货单据子单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
List<ReceiveStockinDetail> list = receiveStockinDetailService.selectReceiveStockinDetailList(receiveStockinDetail);
|
||||
ExcelUtil<ReceiveStockinDetail> util = new ExcelUtil<ReceiveStockinDetail>(ReceiveStockinDetail.class);
|
||||
util.exportExcel(response, list, "收货单据子单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收货单据子单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:query')")
|
||||
@GetMapping(value = "/{stockinDetailId}")
|
||||
public AjaxResult getInfo(@PathVariable("stockinDetailId") String stockinDetailId)
|
||||
{
|
||||
return success(receiveStockinDetailService.selectReceiveStockinDetailByStockinDetailId(stockinDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收货单据子单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:add')")
|
||||
@Log(title = "收货单据子单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
return toAjax(receiveStockinDetailService.insertReceiveStockinDetail(receiveStockinDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收货单据子单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:edit')")
|
||||
@Log(title = "收货单据子单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
return toAjax(receiveStockinDetailService.updateReceiveStockinDetail(receiveStockinDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收货单据子单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('receive:stockInDetail:remove')")
|
||||
@Log(title = "收货单据子单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{stockinDetailIds}")
|
||||
public AjaxResult remove(@PathVariable String[] stockinDetailIds)
|
||||
{
|
||||
return toAjax(receiveStockinDetailService.deleteReceiveStockinDetailByStockinDetailIds(stockinDetailIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,413 @@
|
||||
package com.ruoyi.receive.stockindetail.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;
|
||||
|
||||
/**
|
||||
* 收货单据子单对象 receive_stockin_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public class ReceiveStockinDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 子单ID */
|
||||
private String stockinDetailId;
|
||||
|
||||
/** 主单GUID */
|
||||
@Excel(name = "主单GUID")
|
||||
private String stockinGuid;
|
||||
|
||||
/** 主单ID */
|
||||
@Excel(name = "主单ID")
|
||||
private String stockinId;
|
||||
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String lotNo;
|
||||
|
||||
/** 物料ID */
|
||||
@Excel(name = "物料ID")
|
||||
private String productGuid;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
private String productId;
|
||||
|
||||
/** 计划数量 */
|
||||
@Excel(name = "计划数量")
|
||||
private String quantity;
|
||||
|
||||
/** 计划数量(箱) */
|
||||
@Excel(name = "计划数量(箱)")
|
||||
private String quantityX;
|
||||
|
||||
/** 计划数量(件) */
|
||||
@Excel(name = "计划数量(件)")
|
||||
private String quantityJ;
|
||||
|
||||
/** 参考单价 */
|
||||
@Excel(name = "参考单价")
|
||||
private String price;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String cargoNo;
|
||||
|
||||
/** 实际数量 */
|
||||
@Excel(name = "实际数量")
|
||||
private String assignNum;
|
||||
|
||||
/** 实际数量(箱) */
|
||||
@Excel(name = "实际数量(箱)")
|
||||
private String assignNumX;
|
||||
|
||||
/** 实际数量(件) */
|
||||
@Excel(name = "实际数量(件)")
|
||||
private String assignNumJ;
|
||||
|
||||
/** 入库日期 */
|
||||
@Excel(name = "入库日期")
|
||||
private String printDate;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String stockStatus;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String supplierId;
|
||||
|
||||
/** 客户编码 */
|
||||
@Excel(name = "客户编码")
|
||||
private String customerId;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
private String spec;
|
||||
|
||||
/** 备用字段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 setStockinDetailId(String stockinDetailId)
|
||||
{
|
||||
this.stockinDetailId = stockinDetailId;
|
||||
}
|
||||
|
||||
public String getStockinDetailId()
|
||||
{
|
||||
return stockinDetailId;
|
||||
}
|
||||
|
||||
public void setStockinGuid(String stockinGuid)
|
||||
{
|
||||
this.stockinGuid = stockinGuid;
|
||||
}
|
||||
|
||||
public String getStockinGuid()
|
||||
{
|
||||
return stockinGuid;
|
||||
}
|
||||
|
||||
public void setStockinId(String stockinId)
|
||||
{
|
||||
this.stockinId = stockinId;
|
||||
}
|
||||
|
||||
public String getStockinId()
|
||||
{
|
||||
return stockinId;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo)
|
||||
{
|
||||
this.lotNo = lotNo;
|
||||
}
|
||||
|
||||
public String getLotNo()
|
||||
{
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setQuantity(String quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantityX(String quantityX)
|
||||
{
|
||||
this.quantityX = quantityX;
|
||||
}
|
||||
|
||||
public String getQuantityX()
|
||||
{
|
||||
return quantityX;
|
||||
}
|
||||
|
||||
public void setQuantityJ(String quantityJ)
|
||||
{
|
||||
this.quantityJ = quantityJ;
|
||||
}
|
||||
|
||||
public String getQuantityJ()
|
||||
{
|
||||
return quantityJ;
|
||||
}
|
||||
|
||||
public void setPrice(String price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setCargoNo(String cargoNo)
|
||||
{
|
||||
this.cargoNo = cargoNo;
|
||||
}
|
||||
|
||||
public String getCargoNo()
|
||||
{
|
||||
return cargoNo;
|
||||
}
|
||||
|
||||
public void setAssignNum(String assignNum)
|
||||
{
|
||||
this.assignNum = assignNum;
|
||||
}
|
||||
|
||||
public String getAssignNum()
|
||||
{
|
||||
return assignNum;
|
||||
}
|
||||
|
||||
public void setAssignNumX(String assignNumX)
|
||||
{
|
||||
this.assignNumX = assignNumX;
|
||||
}
|
||||
|
||||
public String getAssignNumX()
|
||||
{
|
||||
return assignNumX;
|
||||
}
|
||||
|
||||
public void setAssignNumJ(String assignNumJ)
|
||||
{
|
||||
this.assignNumJ = assignNumJ;
|
||||
}
|
||||
|
||||
public String getAssignNumJ()
|
||||
{
|
||||
return assignNumJ;
|
||||
}
|
||||
|
||||
public void setPrintDate(String printDate)
|
||||
{
|
||||
this.printDate = printDate;
|
||||
}
|
||||
|
||||
public String getPrintDate()
|
||||
{
|
||||
return printDate;
|
||||
}
|
||||
|
||||
public void setStockStatus(String stockStatus)
|
||||
{
|
||||
this.stockStatus = stockStatus;
|
||||
}
|
||||
|
||||
public String getStockStatus()
|
||||
{
|
||||
return stockStatus;
|
||||
}
|
||||
|
||||
public void setSupplierId(String supplierId)
|
||||
{
|
||||
this.supplierId = supplierId;
|
||||
}
|
||||
|
||||
public String getSupplierId()
|
||||
{
|
||||
return supplierId;
|
||||
}
|
||||
|
||||
public void setCustomerId(String customerId)
|
||||
{
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public String getCustomerId()
|
||||
{
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setSpec(String spec)
|
||||
{
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getSpec()
|
||||
{
|
||||
return spec;
|
||||
}
|
||||
|
||||
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("stockinDetailId", getStockinDetailId())
|
||||
.append("stockinGuid", getStockinGuid())
|
||||
.append("stockinId", getStockinId())
|
||||
.append("lotNo", getLotNo())
|
||||
.append("productGuid", getProductGuid())
|
||||
.append("productId", getProductId())
|
||||
.append("quantity", getQuantity())
|
||||
.append("quantityX", getQuantityX())
|
||||
.append("quantityJ", getQuantityJ())
|
||||
.append("price", getPrice())
|
||||
.append("cargoNo", getCargoNo())
|
||||
.append("remark", getRemark())
|
||||
.append("assignNum", getAssignNum())
|
||||
.append("assignNumX", getAssignNumX())
|
||||
.append("assignNumJ", getAssignNumJ())
|
||||
.append("printDate", getPrintDate())
|
||||
.append("stockStatus", getStockStatus())
|
||||
.append("supplierId", getSupplierId())
|
||||
.append("customerId", getCustomerId())
|
||||
.append("unit", getUnit())
|
||||
.append("spec", getSpec())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("spare4", getSpare4())
|
||||
.append("spare5", getSpare5())
|
||||
.append("spare6", getSpare6())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.receive.stockindetail.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.receive.stockindetail.domain.ReceiveStockinDetail;
|
||||
|
||||
/**
|
||||
* 收货单据子单Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface ReceiveStockinDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询收货单据子单
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 收货单据子单
|
||||
*/
|
||||
public ReceiveStockinDetail selectReceiveStockinDetailByStockinDetailId(String stockinDetailId);
|
||||
|
||||
/**
|
||||
* 查询收货单据子单列表
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 收货单据子单集合
|
||||
*/
|
||||
public List<ReceiveStockinDetail> selectReceiveStockinDetailList(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 新增收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 修改收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 删除收货单据子单
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinDetailByStockinDetailId(String stockinDetailId);
|
||||
|
||||
/**
|
||||
* 批量删除收货单据子单
|
||||
*
|
||||
* @param stockinDetailIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinDetailByStockinDetailIds(String[] stockinDetailIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.receive.stockindetail.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.receive.stockindetail.domain.ReceiveStockinDetail;
|
||||
|
||||
/**
|
||||
* 收货单据子单Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface IReceiveStockinDetailService
|
||||
{
|
||||
/**
|
||||
* 查询收货单据子单
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 收货单据子单
|
||||
*/
|
||||
public ReceiveStockinDetail selectReceiveStockinDetailByStockinDetailId(String stockinDetailId);
|
||||
|
||||
/**
|
||||
* 查询收货单据子单列表
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 收货单据子单集合
|
||||
*/
|
||||
public List<ReceiveStockinDetail> selectReceiveStockinDetailList(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 新增收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 修改收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail);
|
||||
|
||||
/**
|
||||
* 批量删除收货单据子单
|
||||
*
|
||||
* @param stockinDetailIds 需要删除的收货单据子单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinDetailByStockinDetailIds(String[] stockinDetailIds);
|
||||
|
||||
/**
|
||||
* 删除收货单据子单信息
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteReceiveStockinDetailByStockinDetailId(String stockinDetailId);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.receive.stockindetail.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.receive.stockindetail.mapper.ReceiveStockinDetailMapper;
|
||||
import com.ruoyi.receive.stockindetail.domain.ReceiveStockinDetail;
|
||||
import com.ruoyi.receive.stockindetail.service.IReceiveStockinDetailService;
|
||||
|
||||
/**
|
||||
* 收货单据子单Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@Service
|
||||
public class ReceiveStockinDetailServiceImpl implements IReceiveStockinDetailService
|
||||
{
|
||||
@Autowired
|
||||
private ReceiveStockinDetailMapper receiveStockinDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询收货单据子单
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 收货单据子单
|
||||
*/
|
||||
@Override
|
||||
public ReceiveStockinDetail selectReceiveStockinDetailByStockinDetailId(String stockinDetailId)
|
||||
{
|
||||
return receiveStockinDetailMapper.selectReceiveStockinDetailByStockinDetailId(stockinDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询收货单据子单列表
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 收货单据子单
|
||||
*/
|
||||
@Override
|
||||
public List<ReceiveStockinDetail> selectReceiveStockinDetailList(ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
return receiveStockinDetailMapper.selectReceiveStockinDetailList(receiveStockinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
return receiveStockinDetailMapper.insertReceiveStockinDetail(receiveStockinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收货单据子单
|
||||
*
|
||||
* @param receiveStockinDetail 收货单据子单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateReceiveStockinDetail(ReceiveStockinDetail receiveStockinDetail)
|
||||
{
|
||||
return receiveStockinDetailMapper.updateReceiveStockinDetail(receiveStockinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除收货单据子单
|
||||
*
|
||||
* @param stockinDetailIds 需要删除的收货单据子单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteReceiveStockinDetailByStockinDetailIds(String[] stockinDetailIds)
|
||||
{
|
||||
return receiveStockinDetailMapper.deleteReceiveStockinDetailByStockinDetailIds(stockinDetailIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收货单据子单信息
|
||||
*
|
||||
* @param stockinDetailId 收货单据子单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteReceiveStockinDetailByStockinDetailId(String stockinDetailId)
|
||||
{
|
||||
return receiveStockinDetailMapper.deleteReceiveStockinDetailByStockinDetailId(stockinDetailId);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.bas.BasProduct.mapper.BasProductMapper">
|
||||
|
||||
|
||||
<resultMap type="BasProduct" id="BasProductResult">
|
||||
<result property="productGuid" column="product_guid" />
|
||||
<result property="productId" column="product_id" />
|
||||
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id like concat('%', #{parentId}, '%')</if>
|
||||
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
|
||||
@@ -45,11 +45,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBasProductByProductGuid" parameterType="String" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_guid = #{productGuid}
|
||||
</select>
|
||||
<select id="selectBasProductListByProductGuids" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_guid in
|
||||
<foreach collection="productGuids" item="productGuid" open="(" separator="," close=")">
|
||||
#{productGuid}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertBasProduct" parameterType="BasProduct">
|
||||
insert into bas_product
|
||||
@@ -115,9 +122,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasProductByProductGuids" parameterType="String">
|
||||
delete from bas_product where product_guid in
|
||||
delete from bas_product where product_guid in
|
||||
<foreach item="productGuid" collection="array" open="(" separator="," close=")">
|
||||
#{productGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<?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.receive.stockindetail.mapper.ReceiveStockinDetailMapper">
|
||||
|
||||
<resultMap type="ReceiveStockinDetail" id="ReceiveStockinDetailResult">
|
||||
<result property="stockinDetailId" column="stockin_detail_id" />
|
||||
<result property="stockinGuid" column="stockin_guid" />
|
||||
<result property="stockinId" column="stockin_id" />
|
||||
<result property="lotNo" column="lot_no" />
|
||||
<result property="productGuid" column="product_guid" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="quantityX" column="quantity_x" />
|
||||
<result property="quantityJ" column="quantity_j" />
|
||||
<result property="price" column="price" />
|
||||
<result property="cargoNo" column="cargo_no" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="assignNum" column="assign_num" />
|
||||
<result property="assignNumX" column="assign_num_x" />
|
||||
<result property="assignNumJ" column="assign_num_j" />
|
||||
<result property="printDate" column="print_date" />
|
||||
<result property="stockStatus" column="stock_status" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="spec" column="spec" />
|
||||
<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="selectReceiveStockinDetailVo">
|
||||
select stockin_detail_id, stockin_guid, stockin_id, lot_no, product_guid, product_id, quantity, quantity_x, quantity_j, price, cargo_no, remark, assign_num, assign_num_x, assign_num_j, print_date, stock_status, supplier_id, customer_id, unit, spec, spare1, spare2, spare3, spare4, spare5, spare6 from receive_stockin_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectReceiveStockinDetailList" parameterType="ReceiveStockinDetail" resultMap="ReceiveStockinDetailResult">
|
||||
<include refid="selectReceiveStockinDetailVo"/>
|
||||
<where>
|
||||
<if test="stockinGuid != null and stockinGuid != ''"> and stockin_guid = #{stockinGuid}</if>
|
||||
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
|
||||
<if test="quantityX != null and quantityX != ''"> and quantity_x = #{quantityX}</if>
|
||||
<if test="quantityJ != null and quantityJ != ''"> and quantity_j = #{quantityJ}</if>
|
||||
<if test="price != null and price != ''"> and price = #{price}</if>
|
||||
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
|
||||
<if test="assignNum != null and assignNum != ''"> and assign_num = #{assignNum}</if>
|
||||
<if test="assignNumX != null and assignNumX != ''"> and assign_num_x = #{assignNumX}</if>
|
||||
<if test="assignNumJ != null and assignNumJ != ''"> and assign_num_j = #{assignNumJ}</if>
|
||||
<if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if>
|
||||
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
|
||||
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="spec != null and spec != ''"> and spec = #{spec}</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="selectReceiveStockinDetailByStockinDetailId" parameterType="String" resultMap="ReceiveStockinDetailResult">
|
||||
<include refid="selectReceiveStockinDetailVo"/>
|
||||
where stockin_detail_id = #{stockinDetailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertReceiveStockinDetail" parameterType="ReceiveStockinDetail">
|
||||
insert into receive_stockin_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="stockinDetailId != null">stockin_detail_id,</if>
|
||||
<if test="stockinGuid != null and stockinGuid != ''">stockin_guid,</if>
|
||||
<if test="stockinId != null and stockinId != ''">stockin_id,</if>
|
||||
<if test="lotNo != null and lotNo != ''">lot_no,</if>
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="productId != null and productId != ''">product_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="quantityX != null">quantity_x,</if>
|
||||
<if test="quantityJ != null">quantity_j,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="cargoNo != null">cargo_no,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="assignNum != null">assign_num,</if>
|
||||
<if test="assignNumX != null">assign_num_x,</if>
|
||||
<if test="assignNumJ != null">assign_num_j,</if>
|
||||
<if test="printDate != null">print_date,</if>
|
||||
<if test="stockStatus != null">stock_status,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="spec != null">spec,</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="stockinDetailId != null">#{stockinDetailId},</if>
|
||||
<if test="stockinGuid != null and stockinGuid != ''">#{stockinGuid},</if>
|
||||
<if test="stockinId != null and stockinId != ''">#{stockinId},</if>
|
||||
<if test="lotNo != null and lotNo != ''">#{lotNo},</if>
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="productId != null and productId != ''">#{productId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="quantityX != null">#{quantityX},</if>
|
||||
<if test="quantityJ != null">#{quantityJ},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="cargoNo != null">#{cargoNo},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="assignNum != null">#{assignNum},</if>
|
||||
<if test="assignNumX != null">#{assignNumX},</if>
|
||||
<if test="assignNumJ != null">#{assignNumJ},</if>
|
||||
<if test="printDate != null">#{printDate},</if>
|
||||
<if test="stockStatus != null">#{stockStatus},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="spec != null">#{spec},</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>
|
||||
|
||||
<update id="updateReceiveStockinDetail" parameterType="ReceiveStockinDetail">
|
||||
update receive_stockin_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stockinGuid != null and stockinGuid != ''">stockin_guid = #{stockinGuid},</if>
|
||||
<if test="stockinId != null and stockinId != ''">stockin_id = #{stockinId},</if>
|
||||
<if test="lotNo != null and lotNo != ''">lot_no = #{lotNo},</if>
|
||||
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
||||
<if test="productId != null and productId != ''">product_id = #{productId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="quantityX != null">quantity_x = #{quantityX},</if>
|
||||
<if test="quantityJ != null">quantity_j = #{quantityJ},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="assignNum != null">assign_num = #{assignNum},</if>
|
||||
<if test="assignNumX != null">assign_num_x = #{assignNumX},</if>
|
||||
<if test="assignNumJ != null">assign_num_j = #{assignNumJ},</if>
|
||||
<if test="printDate != null">print_date = #{printDate},</if>
|
||||
<if test="stockStatus != null">stock_status = #{stockStatus},</if>
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="spec != null">spec = #{spec},</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 stockin_detail_id = #{stockinDetailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteReceiveStockinDetailByStockinDetailId" parameterType="String">
|
||||
delete from receive_stockin_detail where stockin_detail_id = #{stockinDetailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteReceiveStockinDetailByStockinDetailIds" parameterType="String">
|
||||
delete from receive_stockin_detail where stockin_detail_id in
|
||||
<foreach item="stockinDetailId" collection="array" open="(" separator="," close=")">
|
||||
#{stockinDetailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,143 @@
|
||||
<?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.receive.stockin.mapper.ReceiveStockinMapper">
|
||||
|
||||
<resultMap type="ReceiveStockin" id="ReceiveStockinResult">
|
||||
<result property="stockinGuid" column="stockin_guid" />
|
||||
<result property="stockinId" column="stockin_id" />
|
||||
<result property="inType" column="in_type" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="createManId" column="create_man_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="finishDate" column="finish_date" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="erpBill" column="erp_bill" />
|
||||
<result property="stockSource" column="stock_source" />
|
||||
<result property="departmentNo" column="department_no" />
|
||||
<result property="customerNo" column="customer_no" />
|
||||
<result property="classNo" column="class_no" />
|
||||
<result property="supplierNo" column="supplier_no" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectReceiveStockinVo">
|
||||
select stockin_guid, stockin_id, in_type, create_date, create_man_id, status, warehouse_id, spare5, spare4, spare3, finish_date, spare2, spare1, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no from receive_stockin
|
||||
</sql>
|
||||
|
||||
<select id="selectReceiveStockinList" parameterType="ReceiveStockin" resultMap="ReceiveStockinResult">
|
||||
<include refid="selectReceiveStockinVo"/>
|
||||
<where>
|
||||
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
|
||||
<if test="inType != null and inType != ''"> and in_type = #{inType}</if>
|
||||
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
|
||||
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
<if test="finishDate != null and finishDate != ''"> and finish_date = #{finishDate}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
|
||||
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
|
||||
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
|
||||
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
|
||||
<if test="classNo != null and classNo != ''"> and class_no = #{classNo}</if>
|
||||
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectReceiveStockinByStockinGuid" parameterType="String" resultMap="ReceiveStockinResult">
|
||||
<include refid="selectReceiveStockinVo"/>
|
||||
where stockin_guid = #{stockinGuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertReceiveStockin" parameterType="ReceiveStockin">
|
||||
insert into receive_stockin
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="stockinGuid != null">stockin_guid,</if>
|
||||
<if test="stockinId != null and stockinId != ''">stockin_id,</if>
|
||||
<if test="inType != null and inType != ''">in_type,</if>
|
||||
<if test="createDate != null and createDate != ''">create_date,</if>
|
||||
<if test="createManId != null">create_man_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="finishDate != null">finish_date,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="erpBill != null">erp_bill,</if>
|
||||
<if test="stockSource != null">stock_source,</if>
|
||||
<if test="departmentNo != null">department_no,</if>
|
||||
<if test="customerNo != null">customer_no,</if>
|
||||
<if test="classNo != null">class_no,</if>
|
||||
<if test="supplierNo != null">supplier_no,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockinGuid != null">#{stockinGuid},</if>
|
||||
<if test="stockinId != null and stockinId != ''">#{stockinId},</if>
|
||||
<if test="inType != null and inType != ''">#{inType},</if>
|
||||
<if test="createDate != null and createDate != ''">#{createDate},</if>
|
||||
<if test="createManId != null">#{createManId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="finishDate != null">#{finishDate},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="erpBill != null">#{erpBill},</if>
|
||||
<if test="stockSource != null">#{stockSource},</if>
|
||||
<if test="departmentNo != null">#{departmentNo},</if>
|
||||
<if test="customerNo != null">#{customerNo},</if>
|
||||
<if test="classNo != null">#{classNo},</if>
|
||||
<if test="supplierNo != null">#{supplierNo},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateReceiveStockin" parameterType="ReceiveStockin">
|
||||
update receive_stockin
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stockinId != null and stockinId != ''">stockin_id = #{stockinId},</if>
|
||||
<if test="inType != null and inType != ''">in_type = #{inType},</if>
|
||||
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
|
||||
<if test="createManId != null">create_man_id = #{createManId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="finishDate != null">finish_date = #{finishDate},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="erpBill != null">erp_bill = #{erpBill},</if>
|
||||
<if test="stockSource != null">stock_source = #{stockSource},</if>
|
||||
<if test="departmentNo != null">department_no = #{departmentNo},</if>
|
||||
<if test="customerNo != null">customer_no = #{customerNo},</if>
|
||||
<if test="classNo != null">class_no = #{classNo},</if>
|
||||
<if test="supplierNo != null">supplier_no = #{supplierNo},</if>
|
||||
</trim>
|
||||
where stockin_guid = #{stockinGuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteReceiveStockinByStockinGuid" parameterType="String">
|
||||
delete from receive_stockin where stockin_guid = #{stockinGuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteReceiveStockinByStockinGuids" parameterType="String">
|
||||
delete from receive_stockin where stockin_guid in
|
||||
<foreach item="stockinGuid" collection="array" open="(" separator="," close=")">
|
||||
#{stockinGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -124,7 +124,11 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
44
ruoyi-ui/src/api/receive/stockInDetail.js
Normal file
44
ruoyi-ui/src/api/receive/stockInDetail.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询收货单据子单列表
|
||||
export function listStockInDetail(query) {
|
||||
return request({
|
||||
url: '/receive/stockInDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收货单据子单详细
|
||||
export function getStockInDetail(stockinDetailId) {
|
||||
return request({
|
||||
url: '/receive/stockInDetail/' + stockinDetailId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收货单据子单
|
||||
export function addStockInDetail(data) {
|
||||
return request({
|
||||
url: '/receive/stockInDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改收货单据子单
|
||||
export function updateStockInDetail(data) {
|
||||
return request({
|
||||
url: '/receive/stockInDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除收货单据子单
|
||||
export function delStockInDetail(stockinDetailId) {
|
||||
return request({
|
||||
url: '/receive/stockInDetail/' + stockinDetailId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
56
ruoyi-ui/src/api/receive/stockin.js
Normal file
56
ruoyi-ui/src/api/receive/stockin.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询收货单据列表
|
||||
export function listStockin(query) {
|
||||
return request({
|
||||
url: '/receive/stockin/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收货单据详细
|
||||
export function getStockin(stockinGuid) {
|
||||
return request({
|
||||
url: '/receive/stockin/' + stockinGuid,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收货单据
|
||||
export function addStockin(data) {
|
||||
return request({
|
||||
url: '/receive/stockin',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 解析导入文件
|
||||
export function analyseExportFile(file) {
|
||||
return request({
|
||||
url: '/receive/stockin/analyseExportFile',
|
||||
method: 'post',
|
||||
data: file,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 修改收货单据
|
||||
export function updateStockin(data) {
|
||||
return request({
|
||||
url: '/receive/stockin',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除收货单据
|
||||
export function delStockin(stockinGuid) {
|
||||
return request({
|
||||
url: '/receive/stockin/' + stockinGuid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -197,7 +197,7 @@
|
||||
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" v-if="false" />
|
||||
<el-table-column label="入库订单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="入库类型" align="center" prop="inType">
|
||||
<template slot-scope="scope">
|
||||
@@ -256,7 +256,7 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInDetailList" @selection-change="handleSelectionChange" >
|
||||
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
@@ -405,12 +405,14 @@ export default {
|
||||
this.stockInList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
if (this.stockInList.length > 0){
|
||||
var length = this.stockInList.length;
|
||||
if (length > 0){
|
||||
var data = this.stockInList.at(0);
|
||||
this.getDetailList(data.stockinId);
|
||||
}else {
|
||||
console.log("没有数据")
|
||||
this.stockInDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
521
ruoyi-ui/src/views/receive/stockInDetail/index.vue
Normal file
521
ruoyi-ui/src/views/receive/stockInDetail/index.vue
Normal file
@@ -0,0 +1,521 @@
|
||||
<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="主单GUID" prop="stockinGuid">
|
||||
<el-input
|
||||
v-model="queryParams.stockinGuid"
|
||||
placeholder="请输入主单GUID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主单ID" prop="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入主单ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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="物料ID" prop="productGuid">
|
||||
<el-input
|
||||
v-model="queryParams.productGuid"
|
||||
placeholder="请输入物料ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入物料编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参考单价" prop="price">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入参考单价"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="cargoNo">
|
||||
<el-input
|
||||
v-model="queryParams.cargoNo"
|
||||
placeholder="请输入品牌"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="printDate">
|
||||
<el-input
|
||||
v-model="queryParams.printDate"
|
||||
placeholder="请输入入库日期"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="供应商编码" prop="supplierId">
|
||||
<el-input
|
||||
v-model="queryParams.supplierId"
|
||||
placeholder="请输入供应商编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerId">
|
||||
<el-input
|
||||
v-model="queryParams.customerId"
|
||||
placeholder="请输入客户编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单位" prop="unit">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input
|
||||
v-model="queryParams.spec"
|
||||
placeholder="请输入规格"
|
||||
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="['receive:stockInDetail: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="['receive:stockInDetail: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="['receive:stockInDetail: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="['receive:stockInDetail:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="主单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<el-table-column label="物料ID" align="center" prop="productGuid" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||
<el-table-column label="计划数量(箱)" align="center" prop="quantityX" />
|
||||
<el-table-column label="计划数量(件)" align="center" prop="quantityJ" />
|
||||
<el-table-column label="参考单价" align="center" prop="price" />
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
||||
<el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />
|
||||
<el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />
|
||||
<el-table-column label="入库日期" align="center" prop="printDate" />
|
||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||
<el-table-column label="客户编码" align="center" prop="customerId" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<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="['receive:stockInDetail:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockInDetail: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="主单GUID" prop="stockinGuid">
|
||||
<el-input v-model="form.stockinGuid" placeholder="请输入主单GUID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主单ID" prop="stockinId">
|
||||
<el-input v-model="form.stockinId" placeholder="请输入主单ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="lotNo">
|
||||
<el-input v-model="form.lotNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料ID" prop="productGuid">
|
||||
<el-input v-model="form.productGuid" placeholder="请输入物料ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参考单价" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入参考单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="cargoNo">
|
||||
<el-input v-model="form.cargoNo" placeholder="请输入品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="printDate">
|
||||
<el-input v-model="form.printDate" placeholder="请输入入库日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierId">
|
||||
<el-input v-model="form.supplierId" placeholder="请输入供应商编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerId">
|
||||
<el-input v-model="form.customerId" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input v-model="form.spec" placeholder="请输入规格" />
|
||||
</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 { listStockInDetail, getStockInDetail, delStockInDetail, addStockInDetail, updateStockInDetail } from "@/api/receive/stockInDetail"
|
||||
|
||||
export default {
|
||||
name: "StockInDetail",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 收货单据子单表格数据
|
||||
stockInDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
lotNo: null,
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
quantity: null,
|
||||
quantityX: null,
|
||||
quantityJ: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
assignNum: null,
|
||||
assignNumX: null,
|
||||
assignNumJ: null,
|
||||
printDate: null,
|
||||
stockStatus: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockinGuid: [
|
||||
{ required: true, message: "主单GUID不能为空", trigger: "blur" }
|
||||
],
|
||||
stockinId: [
|
||||
{ required: true, message: "主单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
lotNo: [
|
||||
{ required: true, message: "批次号不能为空", trigger: "blur" }
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: "物料编码不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询收货单据子单列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listStockInDetail(this.queryParams).then(response => {
|
||||
this.stockInDetailList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockinDetailId: null,
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
lotNo: null,
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
quantity: null,
|
||||
quantityX: null,
|
||||
quantityJ: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
remark: null,
|
||||
assignNum: null,
|
||||
assignNumX: null,
|
||||
assignNumJ: null,
|
||||
printDate: null,
|
||||
stockStatus: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
unit: null,
|
||||
spec: 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.stockinDetailId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加收货单据子单"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockinDetailId = row.stockinDetailId || this.ids
|
||||
getStockInDetail(stockinDetailId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改收货单据子单"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.stockinDetailId != null) {
|
||||
updateStockInDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addStockInDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockinDetailIds = row.stockinDetailId || this.ids
|
||||
this.$modal.confirm('是否确认删除收货单据子单编号为"' + stockinDetailIds + '"的数据项?').then(function() {
|
||||
return delStockInDetail(stockinDetailIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('receive/stockInDetail/export', {
|
||||
...this.queryParams
|
||||
}, `stockInDetail_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
453
ruoyi-ui/src/views/receive/stockin/add/index.vue
Normal file
453
ruoyi-ui/src/views/receive/stockin/add/index.vue
Normal file
@@ -0,0 +1,453 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="form-container">
|
||||
<div class="form-header">
|
||||
<span>新增入库单</span>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select v-model="form.warehouseId" placeholder="请选择仓库">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="form.supplierId" placeholder="请选择供应商">
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.supplierNo"
|
||||
:label="item.simpleName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input v-model="form.batchNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注信息"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="product-container">
|
||||
<div class="product-header">
|
||||
<span>入库物料</span>
|
||||
<el-row>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleAddProduct" v-hasPermi="['bas:BasProduct:list']">添加物料</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-download" size="mini" @click="handleImport" v-hasPermi="['receive:stockin:import']">导入物料</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table :data="productList" border>
|
||||
<el-table-column type="index" label="序号" width="50" align="center"/>
|
||||
<el-table-column label="GUID" align="center" prop="productGuid"/>
|
||||
<el-table-column label="父节点id" align="center" prop="parentId"/>
|
||||
<el-table-column label="物料编码" align="center" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="center" prop="productName"/>
|
||||
<el-table-column label="价格" align="center" prop="price"/>
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo"/>
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="规格" align="center" prop="spec"/>
|
||||
<el-table-column label="描述" align="center" prop="remark"/>
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" v-if="false"/> -->
|
||||
<!-- <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="批号" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.lotNo"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库数量" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.quantity"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.price"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quantity * scope.row.price).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDeleteProduct(scope.$index)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="total-info" style="margin-top: 15px; text-align: right">
|
||||
<span>总数量:{{ totalQuantity }}</span>
|
||||
<span style="margin-left: 20px">总金额:{{ totalAmount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit-block" style="margin-top: 20px; text-align: right">
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['receive:stockin:add']">提交收货单</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 选择物料对话框 -->
|
||||
<el-dialog :title="'选择物料'" :visible.sync="productSelectVisible" width="800px" append-to-body>
|
||||
<el-table :data="productOptions" border @selection-change="handleProductSelectionChange">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column label="GUID" align="center" prop="productGuid"/>
|
||||
<el-table-column label="父节点id" align="center" prop="parentId"/>
|
||||
<el-table-column label="物料编码" align="center" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="center" prop="productName"/>
|
||||
<el-table-column label="价格" align="center" prop="price"/>
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo"/>
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="规格" align="center" prop="spec"/>
|
||||
<el-table-column label="描述" align="center" prop="remark"/>
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" v-if="false"/> -->
|
||||
<!-- <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>
|
||||
<pagination
|
||||
v-show="productTotal>0"
|
||||
:total="productTotal"
|
||||
:page.sync="queryProductParams.pageNum"
|
||||
:limit.sync="queryProductParams.pageSize"
|
||||
@pagination="getProductList"
|
||||
/>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelectProduct">确 定</el-button>
|
||||
<el-button @click="productSelectVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物料导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addStockin} from "@/api/receive/stockin";
|
||||
import {listBasProduct} from "@/api/bas/BasProduct";
|
||||
import {listBasSupplier} from "@/api/bas/BasSupplier";
|
||||
import { getToken } from "@/utils/auth"
|
||||
|
||||
|
||||
export default {
|
||||
name: "InAdd",
|
||||
dicts: ['sys_normal_disable', 'is_active', 'storage_cond'],
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
file: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
warehouseId: [
|
||||
{required: true, message: "请选择仓库", trigger: "change"}
|
||||
],
|
||||
supplierId: [
|
||||
{required: true, message: "请选择供应商", trigger: "change"}
|
||||
],
|
||||
|
||||
|
||||
},
|
||||
// 仓库选项
|
||||
warehouseOptions: [
|
||||
{warehouseId: 1, warehouseName: "主仓库"},
|
||||
{warehouseId: 2, warehouseName: "次仓库"}
|
||||
],
|
||||
// 供应商选项
|
||||
supplierOptions: [],
|
||||
// 物料列表
|
||||
productList: [],
|
||||
// 物料选择对话框
|
||||
productSelectVisible: false,
|
||||
// 物料选项,
|
||||
productOptions: [],
|
||||
// 已选物料
|
||||
selectedProducts: [],
|
||||
// 总数量
|
||||
totalQuantity: 0,
|
||||
// 总金额
|
||||
totalAmount: 0,
|
||||
//物料总数
|
||||
productTotal: 0,
|
||||
//物料查询参数
|
||||
queryProductParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
//物料遮盖
|
||||
productLoading: true,
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/receive/stockin/analyseExportFile",
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//this.getWarehouseList();
|
||||
this.getSupplierList();
|
||||
console.log(this.supplierOptions)
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 获取物料列表 */
|
||||
getProductList() {
|
||||
listBasProduct(this.queryProductParams).then(response => {
|
||||
this.productOptions = response.rows;
|
||||
this.productTotal = response.total;
|
||||
this.productLoading = false;
|
||||
});
|
||||
},
|
||||
/** 获取供应商列表 */
|
||||
getSupplierList() {
|
||||
listBasSupplier().then(response => {
|
||||
this.supplierOptions = response.rows;
|
||||
});
|
||||
},
|
||||
|
||||
/** 添加物料按钮操作 */
|
||||
handleAddProduct() {
|
||||
this.getProductList();
|
||||
this.productSelectVisible = true;
|
||||
},
|
||||
handleExportProduct() {
|
||||
},
|
||||
/** 物料选择变更 */
|
||||
handleProductSelectionChange(selection) {
|
||||
this.selectedProducts = selection;
|
||||
},
|
||||
/** 确认选择物料 */
|
||||
confirmSelectProduct() {
|
||||
const newProducts = this.selectedProducts.map(item => ({
|
||||
productGuid: item.productGuid,
|
||||
productId: item.productId,
|
||||
parentId: item.parentId,
|
||||
price: item.price,
|
||||
cargoNo: item.cargoNo,
|
||||
unit: item.unit,
|
||||
spec: item.spec,
|
||||
remark: item.remark,
|
||||
productName: item.productName,
|
||||
quantity: 1,
|
||||
}));
|
||||
this.productList.push(...newProducts);
|
||||
this.productSelectVisible = false;
|
||||
this.calculateTotal();
|
||||
},
|
||||
/** 删除物料 */
|
||||
handleDeleteProduct(index) {
|
||||
this.productList.splice(index, 1);
|
||||
this.calculateTotal();
|
||||
},
|
||||
/** 计算总计 */
|
||||
calculateTotal() {
|
||||
this.totalQuantity = this.productList.reduce((sum, item) => sum + (item.quantity || 0), 0);
|
||||
this.totalAmount = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.price || 0)), 0);
|
||||
this.form.totalQuantity = this.totalQuantity;
|
||||
this.form.totalAmount = this.totalAmount;
|
||||
},
|
||||
/** 表单提交 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.productList.length === 0) {
|
||||
this.$modal.msgError("请添加入库物料");
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建请求数据
|
||||
const data = {
|
||||
warehouseId: this.form.warehouseId,
|
||||
supplierId: this.form.supplierId,
|
||||
//batchId: this.form.batchNo,
|
||||
productVoList: this.productList.map(item => ({
|
||||
productGuid: item.productGuid,
|
||||
quantity: item.quantity,
|
||||
lotNo: item.lotNo
|
||||
}))
|
||||
};
|
||||
|
||||
// 提交收货单
|
||||
addStockin(data).then(() => {
|
||||
this.$modal.msgSuccess("新增收货单成功");
|
||||
// 重置表单数据
|
||||
this.form = {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
};
|
||||
// 清空物料列表
|
||||
this.productList = [];
|
||||
// 重置计数器
|
||||
this.totalQuantity = 0;
|
||||
this.totalAmount = 0;
|
||||
// 重置表单校验结果
|
||||
this.$refs["form"].resetFields();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.productSelectVisible = false;
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "物料导入"
|
||||
this.upload.open = true
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('/receive/stockin/importTemplate', {
|
||||
}, `product_template_${new Date().getTime()}.xlsx`)
|
||||
},// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
if (response.code === 200) {
|
||||
this.$modal.msgSuccess("导入成功");
|
||||
this.productList.push(...response.data)
|
||||
this.upload.open = false;
|
||||
} else {
|
||||
this.$modal.msgError(response.msg);
|
||||
}
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.form-header {
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.product-container {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin-top: 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.product-header {
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.total-info span {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
558
ruoyi-ui/src/views/receive/stockin/index.vue
Normal file
558
ruoyi-ui/src/views/receive/stockin/index.vue
Normal file
@@ -0,0 +1,558 @@
|
||||
<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="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入入库订单ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="建立时间" prop="createDate">
|
||||
<el-input
|
||||
v-model="queryParams.createDate"
|
||||
placeholder="请输入建立时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createManId">
|
||||
<el-input
|
||||
v-model="queryParams.createManId"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库ID"
|
||||
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="备用字段4" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入备用字段4"
|
||||
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=" 完成日期" prop="finishDate">
|
||||
<el-input
|
||||
v-model="queryParams.finishDate"
|
||||
placeholder="请输入 完成日期"
|
||||
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="备用字段1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入备用字段1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="erp单号" prop="erpBill">
|
||||
<el-input
|
||||
v-model="queryParams.erpBill"
|
||||
placeholder="请输入erp单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据来源" prop="stockSource">
|
||||
<el-input
|
||||
v-model="queryParams.stockSource"
|
||||
placeholder="请输入单据来源"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="客户编码" prop="customerNo">
|
||||
<el-input
|
||||
v-model="queryParams.customerNo"
|
||||
placeholder="请输入客户编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编码" prop="classNo">
|
||||
<el-input
|
||||
v-model="queryParams.classNo"
|
||||
placeholder="请输入班组编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierNo">
|
||||
<el-input
|
||||
v-model="queryParams.supplierNo"
|
||||
placeholder="请输入供应商编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['receive:stockin: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="['receive:stockin: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="['receive:stockin: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="['receive:stockin:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockinList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="入库订单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="入库类型" align="center" prop="inType" />
|
||||
<el-table-column label="建立时间" align="center" prop="createDate" />
|
||||
<el-table-column label="创建人" align="center" prop="createManId" />
|
||||
<el-table-column label="单据状态" align="center" prop="status" />
|
||||
<el-table-column label="仓库ID" align="center" prop="warehouseId" />
|
||||
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
||||
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
|
||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||
<el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||
<el-table-column label="erp单号" align="center" prop="erpBill" />
|
||||
<el-table-column label="单据来源" align="center" prop="stockSource" />
|
||||
<el-table-column label="部门编码" align="center" prop="departmentNo" />
|
||||
<el-table-column label="客户编码" align="center" prop="customerNo" />
|
||||
<el-table-column label="班组编码" align="center" prop="classNo" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierNo" />
|
||||
<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="['receive:stockin:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockin: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-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="主单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<el-table-column label="物料ID" align="center" prop="productGuid" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||
<el-table-column label="计划数量(箱)" align="center" prop="quantityX" />
|
||||
<el-table-column label="计划数量(件)" align="center" prop="quantityJ" />
|
||||
<el-table-column label="参考单价" align="center" prop="price" />
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
||||
<el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />
|
||||
<el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />
|
||||
<el-table-column label="入库日期" align="center" prop="printDate" />
|
||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||
<el-table-column label="客户编码" align="center" prop="customerId" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<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="['receive:stockInDetail:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockInDetail: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="stockinId">
|
||||
<el-input v-model="form.stockinId" placeholder="请输入入库订单ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="建立时间" prop="createDate">
|
||||
<el-input v-model="form.createDate" placeholder="请输入建立时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createManId">
|
||||
<el-input v-model="form.createManId" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
|
||||
</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="备用字段4" prop="spare4">
|
||||
<el-input v-model="form.spare4" placeholder="请输入备用字段4" />
|
||||
</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=" 完成日期" prop="finishDate">
|
||||
<el-input v-model="form.finishDate" placeholder="请输入 完成日期" />
|
||||
</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="备用字段1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入备用字段1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="erp单号" prop="erpBill">
|
||||
<el-input v-model="form.erpBill" placeholder="请输入erp单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据来源" prop="stockSource">
|
||||
<el-input v-model="form.stockSource" placeholder="请输入单据来源" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门编码" prop="departmentNo">
|
||||
<el-input v-model="form.departmentNo" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编码" prop="classNo">
|
||||
<el-input v-model="form.classNo" placeholder="请输入班组编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierNo">
|
||||
<el-input v-model="form.supplierNo" placeholder="请输入供应商编码" />
|
||||
</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 { listStockin, getStockin, delStockin, addStockin, updateStockin } from "@/api/receive/stockin"
|
||||
import { listStockInDetail } from "@/api/receive/stockInDetail"
|
||||
|
||||
export default {
|
||||
name: "Stockin",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
detailLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 收货单据表格数据
|
||||
stockinList: [],
|
||||
stockInDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
createDate: null,
|
||||
createManId: null,
|
||||
status: null,
|
||||
warehouseId: null,
|
||||
spare5: null,
|
||||
spare4: null,
|
||||
spare3: null,
|
||||
finishDate: null,
|
||||
spare2: null,
|
||||
spare1: null,
|
||||
erpBill: null,
|
||||
stockSource: null,
|
||||
departmentNo: null,
|
||||
customerNo: null,
|
||||
classNo: null,
|
||||
supplierNo: null
|
||||
},
|
||||
queryDetailParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinId:null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockinId: [
|
||||
{ required: true, message: "入库订单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
inType: [
|
||||
{ required: true, message: "入库类型不能为空", trigger: "change" }
|
||||
],
|
||||
createDate: [
|
||||
{ required: true, message: "建立时间不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "单据状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询收货单据列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listStockin(this.queryParams).then(response => {
|
||||
this.stockinList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
var length = this.stockinList.length;
|
||||
if (length > 0){
|
||||
var data = this.stockInList.at(0);
|
||||
this.getDetailList(data.stockinId);
|
||||
}else {
|
||||
console.log("没有数据")
|
||||
this.stockInDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
createDate: null,
|
||||
createManId: null,
|
||||
status: null,
|
||||
warehouseId: null,
|
||||
spare5: null,
|
||||
spare4: null,
|
||||
spare3: null,
|
||||
finishDate: null,
|
||||
spare2: null,
|
||||
spare1: null,
|
||||
erpBill: null,
|
||||
stockSource: null,
|
||||
departmentNo: null,
|
||||
customerNo: null,
|
||||
classNo: null,
|
||||
supplierNo: 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.stockinGuid)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加收货单据"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockinGuid = row.stockinGuid || this.ids
|
||||
getStockin(stockinGuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改收货单据"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.stockinGuid != null) {
|
||||
updateStockin(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addStockin(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockinGuids = row.stockinGuid || this.ids
|
||||
this.$modal.confirm('是否确认删除收货单据编号为"' + stockinGuids + '"的数据项?').then(function() {
|
||||
return delStockin(stockinGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('receive/stockin/export', {
|
||||
...this.queryParams
|
||||
}, `stockin_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
handleRowClick(selection){
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user