出库单据

This commit is contained in:
张怡蓉
2025-09-16 10:22:54 +08:00
parent 592ab99c49
commit f3637408cb
13 changed files with 797 additions and 381 deletions

View File

@@ -65,7 +65,6 @@ public class OutStockoutServiceImpl implements IOutStockoutService
* @return 出库主单 * @return 出库主单
*/ */
@Override @Override
@DataScope(warehouseAlias = "bw")
public List<OutStockout> selectOutStockoutList(OutStockout outStockout) public List<OutStockout> selectOutStockoutList(OutStockout outStockout)
{ {
return outStockoutMapper.selectOutStockoutList(outStockout); return outStockoutMapper.selectOutStockoutList(outStockout);
@@ -132,6 +131,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
outStockout.setCreateManId(username); outStockout.setCreateManId(username);
outStockout.setStatus("1"); outStockout.setStatus("1");
outStockout.setStockoutSource("0"); outStockout.setStockoutSource("0");
outStockout.setWarehouseId("01");
for (int i = 0; i < detailList.size(); i++) { for (int i = 0; i < detailList.size(); i++) {
OutStockoutDetail outStockoutDetail = detailList.get(i); OutStockoutDetail outStockoutDetail = detailList.get(i);
outStockoutDetail.setStockoutDetailId(stockOutId + "-" + (i + 1)); outStockoutDetail.setStockoutDetailId(stockOutId + "-" + (i + 1));
@@ -166,10 +166,10 @@ public class OutStockoutServiceImpl implements IOutStockoutService
OutStockout outStockout = outStockoutMapper.selectOutStockoutByStockoutId(stockoutId); OutStockout outStockout = outStockoutMapper.selectOutStockoutByStockoutId(stockoutId);
if (outStockout == null){ if (outStockout == null){
return AjaxResult.warn(MessageUtils.message("warn.message4")); return AjaxResult.warn("单据不存在,请检查!");
} }
if ("1".equals(outStockout.getStatus())){ if ("1".equals(outStockout.getStatus())){
return AjaxResult.warn(MessageUtils.message("warn.message5")); return AjaxResult.warn("单据未审核,请审核无误后再分配!");
} }
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();

View File

@@ -124,7 +124,7 @@ public class OutStockoutDetail extends BaseEntity
/** 物资名称 ASMAT_NAME */ /** 物资名称 ASMAT_NAME */
// @Excel(name = "物资名称 ASMAT_NAME") // @Excel(name = "物资名称 ASMAT_NAME")
// private String productName; private String productName;
/** 供应商代码 SUPPLIER_CODE */ /** 供应商代码 SUPPLIER_CODE */
@Excel(name = "供应商代码 SUPPLIER_CODE") @Excel(name = "供应商代码 SUPPLIER_CODE")
@@ -138,9 +138,102 @@ public class OutStockoutDetail extends BaseEntity
@Excel(name = "生产日期") @Excel(name = "生产日期")
private String printDate; private String printDate;
private ExtraField extraField;
/** 电压 */
@Excel(name = "电压")
private String voltage;
/** 功率 */
@Excel(name = "功率")
private String power;
/** 相位 */
@Excel(name = "相位")
private String phase;
/** 净重 */
@Excel(name = "净重")
private BigDecimal netWeight;
/** 毛重 */
@Excel(name = "毛重")
private BigDecimal grossWeight;
/** 分销 */
@Excel(name = "分销")
private String distribution;
/** 机型 */
@Excel(name = "机型")
private String model;
/** 订单号 */
@Excel(name = "订单号")
private String orderId;
public String getVoltage() {
return voltage;
}
public void setVoltage(String voltage) {
this.voltage = voltage;
}
public String getPower() {
return power;
}
public void setPower(String power) {
this.power = power;
}
public String getPhase() {
return phase;
}
public void setPhase(String phase) {
this.phase = phase;
}
public BigDecimal getNetWeight() {
return netWeight;
}
public void setNetWeight(BigDecimal netWeight) {
this.netWeight = netWeight;
}
public BigDecimal getGrossWeight() {
return grossWeight;
}
public void setGrossWeight(BigDecimal grossWeight) {
this.grossWeight = grossWeight;
}
public String getDistribution() {
return distribution;
}
public void setDistribution(String distribution) {
this.distribution = distribution;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public void setStockoutDetailId(String stockoutDetailId) public void setStockoutDetailId(String stockoutDetailId)
{ {
@@ -433,48 +526,55 @@ public class OutStockoutDetail extends BaseEntity
return printDate; return printDate;
} }
public ExtraField getExtraField() { public String getProductName() {
return extraField; return productName;
} }
public void setExtraField(ExtraField extraField) { public void setProductName(String productName) {
this.extraField = extraField; this.productName = productName;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "OutStockoutDetail{" +
.append("stockoutDetailId", getStockoutDetailId()) "stockoutDetailId='" + stockoutDetailId + '\'' +
.append("stockoutGuid", getStockoutGuid()) ", stockoutGuid='" + stockoutGuid + '\'' +
.append("stockoutId", getStockoutId()) ", stockoutId='" + stockoutId + '\'' +
.append("lotNo", getLotNo()) ", lotNo='" + lotNo + '\'' +
.append("productGuid", getProductGuid()) ", productGuid='" + productGuid + '\'' +
.append("productId", getProductId()) ", productId='" + productId + '\'' +
.append("quantity", getQuantity()) ", quantity=" + quantity +
.append("quantityX", getQuantityX()) ", quantityX=" + quantityX +
.append("quantityJ", getQuantityJ()) ", quantityJ=" + quantityJ +
.append("assignNum", getAssignNum()) ", assignNum=" + assignNum +
.append("assignNumX", getAssignNumX()) ", assignNumX=" + assignNumX +
.append("assignNumJ", getAssignNumJ()) ", assignNumJ=" + assignNumJ +
.append("allotQuantity", getAllotQuantity()) ", allotQuantity=" + allotQuantity +
.append("allotQuantityX", getAllotQuantityX()) ", allotQuantityX=" + allotQuantityX +
.append("allotQuantityJ", getAllotQuantityJ()) ", allotQuantityJ=" + allotQuantityJ +
.append("price", getPrice()) ", price='" + price + '\'' +
.append("remark", getRemark()) ", warehouseId='" + warehouseId + '\'' +
.append("warehouseId", getWarehouseId()) ", outId='" + outId + '\'' +
.append("outId", getOutId()) ", bukechaiQuantity='" + bukechaiQuantity + '\'' +
.append("bukechaiQuantity", getBukechaiQuantity()) ", kechaiQuantity='" + kechaiQuantity + '\'' +
.append("kechaiQuantity", getKechaiQuantity()) ", entryid='" + entryid + '\'' +
.append("entryid", getEntryid()) ", flatQuantity='" + flatQuantity + '\'' +
.append("flatQuantity", getFlatQuantity()) ", fid='" + fid + '\'' +
.append("fid", getFid()) ", erpStockoutId='" + erpStockoutId + '\'' +
.append("erpStockoutId", getErpStockoutId()) ", unit='" + unit + '\'' +
.append("unit", getUnit()) ", spec='" + spec + '\'' +
.append("spec", getSpec()) ", productName='" + productName + '\'' +
.append("supplierId", getSupplierId()) ", supplierId='" + supplierId + '\'' +
.append("cargoNo", getCargoNo()) ", cargoNo='" + cargoNo + '\'' +
.append("createTime", getCreateTime()) ", printDate='" + printDate + '\'' +
.append("printDate", getPrintDate()) ", voltage='" + voltage + '\'' +
.toString(); ", power='" + power + '\'' +
", phase='" + phase + '\'' +
", netWeight=" + netWeight +
", grossWeight=" + grossWeight +
", distribution='" + distribution + '\'' +
", model='" + model + '\'' +
", orderId='" + orderId + '\'' +
'}';
} }
} }

View File

@@ -1,25 +1,31 @@
package com.ruoyi.out.productAndStock.controller; package com.ruoyi.out.productAndStock.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.out.productAndStock.domain.ViewProductAndStock; import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
import com.ruoyi.out.productAndStock.service.IViewProductAndStockService; import com.ruoyi.out.productAndStock.service.IViewProductAndStockService;
import jakarta.servlet.http.HttpServletResponse; import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 可出库的库存物资信息Controller * 库存物资Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-21 * @date 2025-09-12
*/ */
@RestController @RestController
@RequestMapping("/out/productAndStock") @RequestMapping("/out/productAndStock")
@@ -29,7 +35,7 @@ public class ViewProductAndStockController extends BaseController
private IViewProductAndStockService viewProductAndStockService; private IViewProductAndStockService viewProductAndStockService;
/** /**
* 查询可出库的库存物资信息列表 * 查询库存物资列表
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:list')") @PreAuthorize("@ss.hasPermi('out:productAndStock:list')")
@GetMapping("/list") @GetMapping("/list")
@@ -41,20 +47,20 @@ public class ViewProductAndStockController extends BaseController
} }
/** /**
* 导出可出库的库存物资信息列表 * 导出库存物资列表
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:export')") @PreAuthorize("@ss.hasPermi('out:productAndStock:export')")
@Log(title = "可出库的库存物资信息", businessType = BusinessType.EXPORT) @Log(title = "库存物资", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, ViewProductAndStock viewProductAndStock) public void export(HttpServletResponse response, ViewProductAndStock viewProductAndStock)
{ {
List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock); List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock);
ExcelUtil<ViewProductAndStock> util = new ExcelUtil<ViewProductAndStock>(ViewProductAndStock.class); ExcelUtil<ViewProductAndStock> util = new ExcelUtil<ViewProductAndStock>(ViewProductAndStock.class);
util.exportExcel(response, list, "可出库的库存物资信息数据"); util.exportExcel(response, list, "库存物资数据");
} }
/** /**
* 获取可出库的库存物资信息详细信息 * 获取库存物资详细信息
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:query')") @PreAuthorize("@ss.hasPermi('out:productAndStock:query')")
@GetMapping(value = "/{onlyIdentity}") @GetMapping(value = "/{onlyIdentity}")
@@ -64,10 +70,10 @@ public class ViewProductAndStockController extends BaseController
} }
/** /**
* 新增可出库的库存物资信息 * 新增库存物资
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:add')") @PreAuthorize("@ss.hasPermi('out:productAndStock:add')")
@Log(title = "可出库的库存物资信息", businessType = BusinessType.INSERT) @Log(title = "库存物资", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ViewProductAndStock viewProductAndStock) public AjaxResult add(@RequestBody ViewProductAndStock viewProductAndStock)
{ {
@@ -75,10 +81,10 @@ public class ViewProductAndStockController extends BaseController
} }
/** /**
* 修改可出库的库存物资信息 * 修改库存物资
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:edit')") @PreAuthorize("@ss.hasPermi('out:productAndStock:edit')")
@Log(title = "可出库的库存物资信息", businessType = BusinessType.UPDATE) @Log(title = "库存物资", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ViewProductAndStock viewProductAndStock) public AjaxResult edit(@RequestBody ViewProductAndStock viewProductAndStock)
{ {
@@ -86,10 +92,10 @@ public class ViewProductAndStockController extends BaseController
} }
/** /**
* 删除可出库的库存物资信息 * 删除库存物资
*/ */
@PreAuthorize("@ss.hasPermi('out:productAndStock:remove')") @PreAuthorize("@ss.hasPermi('out:productAndStock:remove')")
@Log(title = "可出库的库存物资信息", businessType = BusinessType.DELETE) @Log(title = "库存物资", businessType = BusinessType.DELETE)
@DeleteMapping("/{onlyIdentitys}") @DeleteMapping("/{onlyIdentitys}")
public AjaxResult remove(@PathVariable Long[] onlyIdentitys) public AjaxResult remove(@PathVariable Long[] onlyIdentitys)
{ {

View File

@@ -1,15 +1,16 @@
package com.ruoyi.out.productAndStock.domain; package com.ruoyi.out.productAndStock.domain;
import com.ruoyi.common.annotation.Excel; import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 可出库的库存物资信息对象 view_product_and_stock * 库存物资对象 view_product_and_stock
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-21 * @date 2025-09-12
*/ */
public class ViewProductAndStock extends BaseEntity public class ViewProductAndStock extends BaseEntity
{ {
@@ -19,34 +20,77 @@ public class ViewProductAndStock extends BaseEntity
@Excel(name = "序号") @Excel(name = "序号")
private Long onlyIdentity; private Long onlyIdentity;
/** 物资编码 */ /** 品号 */
@Excel(name = "物资编码") @Excel(name = "品号")
private String productId; private String productId;
/** 批号 */ /** 批次号 */
@Excel(name = "批号") @Excel(name = "批次号")
private String lotNo; private String lotNo;
/** 物资名称 */ /** 品名 */
@Excel(name = "物资名称") @Excel(name = "品名")
private String productName; private String productName;
/** 数量 */ /** 数量 */
@Excel(name = "数量") @Excel(name = "数量")
private String quantity; private BigDecimal quantity;
/** 仓库 */ /** 仓库 */
@Excel(name = "仓库") @Excel(name = "仓库")
private String warehouseId; private String warehouseId;
private String warehouseName;
public String getWarehouseName() { /** 规格 */
return warehouseName; @Excel(name = "规格")
} private String spare1;
public void setWarehouseName(String warehouseName) { /** 单位 */
this.warehouseName = warehouseName; @Excel(name = "单位")
} private String spare3;
/** 型号 */
@Excel(name = "型号")
private String spare4;
/** 颜色 */
@Excel(name = "颜色")
private String spare5;
/** 序列号 */
@Excel(name = "序列号")
private String spare6;
/** 电压 */
@Excel(name = "电压")
private String voltage;
/** 功率 */
@Excel(name = "功率")
private String power;
/** 相位 */
@Excel(name = "相位")
private String phase;
/** 净重 */
@Excel(name = "净重")
private BigDecimal netWeight;
/** 毛重 */
@Excel(name = "毛重")
private BigDecimal grossWeight;
/** 分销 */
@Excel(name = "分销")
private String distribution;
/** 机型 */
@Excel(name = "机型")
private String model;
/** 订单号 */
@Excel(name = "订单号")
private String orderId;
public void setOnlyIdentity(Long onlyIdentity) public void setOnlyIdentity(Long onlyIdentity)
{ {
@@ -88,12 +132,12 @@ public class ViewProductAndStock extends BaseEntity
return productName; return productName;
} }
public void setQuantity(String quantity) public void setQuantity(BigDecimal quantity)
{ {
this.quantity = quantity; this.quantity = quantity;
} }
public String getQuantity() public BigDecimal getQuantity()
{ {
return quantity; return quantity;
} }
@@ -108,6 +152,136 @@ public class ViewProductAndStock extends BaseEntity
return warehouseId; return warehouseId;
} }
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
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 setVoltage(String voltage)
{
this.voltage = voltage;
}
public String getVoltage()
{
return voltage;
}
public void setPower(String power)
{
this.power = power;
}
public String getPower()
{
return power;
}
public void setPhase(String phase)
{
this.phase = phase;
}
public String getPhase()
{
return phase;
}
public void setNetWeight(BigDecimal netWeight)
{
this.netWeight = netWeight;
}
public BigDecimal getNetWeight()
{
return netWeight;
}
public void setGrossWeight(BigDecimal grossWeight)
{
this.grossWeight = grossWeight;
}
public BigDecimal getGrossWeight()
{
return grossWeight;
}
public void setDistribution(String distribution)
{
this.distribution = distribution;
}
public String getDistribution()
{
return distribution;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -117,6 +291,19 @@ public class ViewProductAndStock extends BaseEntity
.append("productName", getProductName()) .append("productName", getProductName())
.append("quantity", getQuantity()) .append("quantity", getQuantity())
.append("warehouseId", getWarehouseId()) .append("warehouseId", getWarehouseId())
.append("spare1", getSpare1())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.append("spare6", getSpare6())
.append("voltage", getVoltage())
.append("power", getPower())
.append("phase", getPhase())
.append("netWeight", getNetWeight())
.append("grossWeight", getGrossWeight())
.append("distribution", getDistribution())
.append("model", getModel())
.append("orderId", getOrderId())
.toString(); .toString();
} }
} }

View File

@@ -1,59 +1,58 @@
package com.ruoyi.out.productAndStock.mapper; package com.ruoyi.out.productAndStock.mapper;
import java.util.List;
import com.ruoyi.out.productAndStock.domain.ViewProductAndStock; import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
import java.util.List;
/** /**
* 可出库的库存物资信息Mapper接口 * 库存物资Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-21 * @date 2025-09-12
*/ */
public interface ViewProductAndStockMapper public interface ViewProductAndStockMapper
{ {
/** /**
* 查询可出库的库存物资信息 * 查询库存物资
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 可出库的库存物资信息 * @return 库存物资
*/ */
public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity); public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity);
/** /**
* 查询可出库的库存物资信息列表 * 查询库存物资列表
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 可出库的库存物资信息集合 * @return 库存物资集合
*/ */
public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock); public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock);
/** /**
* 新增可出库的库存物资信息 * 新增库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
public int insertViewProductAndStock(ViewProductAndStock viewProductAndStock); public int insertViewProductAndStock(ViewProductAndStock viewProductAndStock);
/** /**
* 修改可出库的库存物资信息 * 修改库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
public int updateViewProductAndStock(ViewProductAndStock viewProductAndStock); public int updateViewProductAndStock(ViewProductAndStock viewProductAndStock);
/** /**
* 删除可出库的库存物资信息 * 删除库存物资
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 结果 * @return 结果
*/ */
public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity); public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity);
/** /**
* 批量删除可出库的库存物资信息 * 批量删除库存物资
* *
* @param onlyIdentitys 需要删除的数据主键集合 * @param onlyIdentitys 需要删除的数据主键集合
* @return 结果 * @return 结果

View File

@@ -1,61 +1,60 @@
package com.ruoyi.out.productAndStock.service; package com.ruoyi.out.productAndStock.service;
import java.util.List;
import com.ruoyi.out.productAndStock.domain.ViewProductAndStock; import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
import java.util.List;
/** /**
* 可出库的库存物资信息Service接口 * 库存物资Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-21 * @date 2025-09-12
*/ */
public interface IViewProductAndStockService public interface IViewProductAndStockService
{ {
/** /**
* 查询可出库的库存物资信息 * 查询库存物资
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 可出库的库存物资信息 * @return 库存物资
*/ */
public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity); public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity);
/** /**
* 查询可出库的库存物资信息列表 * 查询库存物资列表
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 可出库的库存物资信息集合 * @return 库存物资集合
*/ */
public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock); public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock);
/** /**
* 新增可出库的库存物资信息 * 新增库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
public int insertViewProductAndStock(ViewProductAndStock viewProductAndStock); public int insertViewProductAndStock(ViewProductAndStock viewProductAndStock);
/** /**
* 修改可出库的库存物资信息 * 修改库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
public int updateViewProductAndStock(ViewProductAndStock viewProductAndStock); public int updateViewProductAndStock(ViewProductAndStock viewProductAndStock);
/** /**
* 批量删除可出库的库存物资信息 * 批量删除库存物资
* *
* @param onlyIdentitys 需要删除的可出库的库存物资信息主键集合 * @param onlyIdentitys 需要删除的库存物资主键集合
* @return 结果 * @return 结果
*/ */
public int deleteViewProductAndStockByOnlyIdentitys(Long[] onlyIdentitys); public int deleteViewProductAndStockByOnlyIdentitys(Long[] onlyIdentitys);
/** /**
* 删除可出库的库存物资信息信息 * 删除库存物资信息
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 结果 * @return 结果
*/ */
public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity); public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity);

View File

@@ -1,18 +1,17 @@
package com.ruoyi.out.productAndStock.service.impl; package com.ruoyi.out.productAndStock.service.impl;
import com.ruoyi.out.productAndStock.domain.ViewProductAndStock; import java.util.List;
import com.ruoyi.out.productAndStock.mapper.ViewProductAndStockMapper;
import com.ruoyi.out.productAndStock.service.IViewProductAndStockService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.out.productAndStock.mapper.ViewProductAndStockMapper;
import java.util.List; import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
import com.ruoyi.out.productAndStock.service.IViewProductAndStockService;
/** /**
* 可出库的库存物资信息Service业务层处理 * 库存物资Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-21 * @date 2025-09-12
*/ */
@Service @Service
public class ViewProductAndStockServiceImpl implements IViewProductAndStockService public class ViewProductAndStockServiceImpl implements IViewProductAndStockService
@@ -21,10 +20,10 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
private ViewProductAndStockMapper viewProductAndStockMapper; private ViewProductAndStockMapper viewProductAndStockMapper;
/** /**
* 查询可出库的库存物资信息 * 查询库存物资
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 可出库的库存物资信息 * @return 库存物资
*/ */
@Override @Override
public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity) public ViewProductAndStock selectViewProductAndStockByOnlyIdentity(Long onlyIdentity)
@@ -33,10 +32,10 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
} }
/** /**
* 查询可出库的库存物资信息列表 * 查询库存物资列表
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 可出库的库存物资信息 * @return 库存物资
*/ */
@Override @Override
public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock) public List<ViewProductAndStock> selectViewProductAndStockList(ViewProductAndStock viewProductAndStock)
@@ -45,9 +44,9 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
} }
/** /**
* 新增可出库的库存物资信息 * 新增库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
@Override @Override
@@ -57,9 +56,9 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
} }
/** /**
* 修改可出库的库存物资信息 * 修改库存物资
* *
* @param viewProductAndStock 可出库的库存物资信息 * @param viewProductAndStock 库存物资
* @return 结果 * @return 结果
*/ */
@Override @Override
@@ -69,9 +68,9 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
} }
/** /**
* 批量删除可出库的库存物资信息 * 批量删除库存物资
* *
* @param onlyIdentitys 需要删除的可出库的库存物资信息主键 * @param onlyIdentitys 需要删除的库存物资主键
* @return 结果 * @return 结果
*/ */
@Override @Override
@@ -81,9 +80,9 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
} }
/** /**
* 删除可出库的库存物资信息信息 * 删除库存物资信息
* *
* @param onlyIdentity 可出库的库存物资信息主键 * @param onlyIdentity 库存物资主键
* @return 结果 * @return 结果
*/ */
@Override @Override

View File

@@ -67,21 +67,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpStockoutId" column="erp_stockout_id" /> <result property="erpStockoutId" column="erp_stockout_id" />
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="spec" column="spec" /> <result property="spec" column="spec" />
<result property="supplierId" column="supplier_id" /> <result property="supplierId" column="supplier_id" />
<result property="cargoNo" column="cargo_no" /> <result property="cargoNo" column="cargo_no" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="printDate" column="print_date" /> <result property="printDate" column="print_date" />
<association property="extraField" javaType="ExtraField"> <result property="voltage" column="voltage" />
<result property="productId" column="product_id" /> <result property="power" column="power" />
<result property="materialDesc" column="product_name" /> <result property="phase" column="phase" />
<result property="englishDesc" column="englishDesc" /> <result property="netWeight" column="net_weight" />
<result property="length" column="length" /> <result property="grossWeight" column="gross_weight" />
<result property="width" column="width" /> <result property="distribution" column="distribution" />
<result property="height" column="height" /> <result property="model" column="model" />
<result property="volume" column="volume" /> <result property="orderId" column="order_id" />
<result property="netWeight" column="netWeight" />
</association>
</resultMap> </resultMap>
<sql id="selectOutStockoutDetailFinishVo"> <sql id="selectOutStockoutDetailFinishVo">
@@ -255,10 +252,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j, d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid, d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date, d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date,
bp.product_name, bp.spare1 as englishDesc, d.voltage, d.power, d.phase, d.net_weight, d.gross_weight, d.distribution, d.model, d.order_id,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume d.product_name
from out_stockout_detail_finish d from out_stockout_detail_finish d
left join bas_product bp on d.product_id = bp.product_id
where stockout_guid = #{stockoutGuid} where stockout_guid = #{stockoutGuid}
</select> </select>
</mapper> </mapper>

View File

@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="lotNo" column="lot_no" /> <result property="lotNo" column="lot_no" />
<result property="productGuid" column="product_guid" /> <result property="productGuid" column="product_guid" />
<result property="productId" column="product_id" /> <result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="quantity" column="quantity" /> <result property="quantity" column="quantity" />
<result property="quantityX" column="quantity_x" /> <result property="quantityX" column="quantity_x" />
<result property="quantityJ" column="quantity_j" /> <result property="quantityJ" column="quantity_j" />
@@ -32,21 +33,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpStockoutId" column="erp_stockout_id" /> <result property="erpStockoutId" column="erp_stockout_id" />
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="spec" column="spec" /> <result property="spec" column="spec" />
<result property="supplierId" column="supplier_id" /> <result property="supplierId" column="supplier_id" />
<result property="cargoNo" column="cargo_no" /> <result property="cargoNo" column="cargo_no" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="printDate" column="print_date" /> <result property="printDate" column="print_date" />
<association property="extraField" javaType="ExtraField"> <result property="voltage" column="voltage" />
<result property="productId" column="product_id" /> <result property="power" column="power" />
<result property="materialDesc" column="product_name" /> <result property="phase" column="phase" />
<result property="englishDesc" column="englishDesc" /> <result property="netWeight" column="net_weight" />
<result property="length" column="length" /> <result property="grossWeight" column="gross_weight" />
<result property="width" column="width" /> <result property="distribution" column="distribution" />
<result property="height" column="height" /> <result property="model" column="model" />
<result property="volume" column="volume" /> <result property="orderId" column="order_id" />
<result property="netWeight" column="netWeight" />
</association>
</resultMap> </resultMap>
<sql id="selectOutStockoutDetailVo"> <sql id="selectOutStockoutDetailVo">
@@ -54,10 +53,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j, d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid, d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date, d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date,
bp.product_name, bp.spare1 as englishDesc, d.voltage, d.power, d.phase, d.net_weight, d.gross_weight, d.distribution, d.model, d.order_id,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume d.product_name
from out_stockout_detail d from out_stockout_detail d
left join bas_product bp on d.product_id = bp.product_id
</sql> </sql>
<select id="selectOutStockoutDetailList" parameterType="OutStockoutDetail" resultMap="OutStockoutDetailResult"> <select id="selectOutStockoutDetailList" parameterType="OutStockoutDetail" resultMap="OutStockoutDetailResult">
@@ -93,6 +91,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierId != null and supplierId != ''"> and d.supplier_id like concat('%', #{supplierId}, '%')</if> <if test="supplierId != null and supplierId != ''"> and d.supplier_id like concat('%', #{supplierId}, '%')</if>
<if test="cargoNo != null and cargoNo != ''"> and d.cargo_no = #{cargoNo}</if> <if test="cargoNo != null and cargoNo != ''"> and d.cargo_no = #{cargoNo}</if>
<if test="printDate != null and printDate != ''"> and d.print_date = #{printDate}</if> <if test="printDate != null and printDate != ''"> and d.print_date = #{printDate}</if>
<if test="voltage != null and voltage != ''"> and d.voltage = #{voltage}</if>
<if test="power != null and power != ''"> and d.power = #{power}</if>
<if test="phase != null and phase != ''"> and d.phase = #{phase}</if>
<if test="netWeight != null "> and d.net_weight = #{netWeight}</if>
<if test="grossWeight != null "> and d.gross_weight = #{grossWeight}</if>
<if test="distribution != null and distribution != ''"> and d.distribution = #{distribution}</if>
<if test="model != null and model != ''"> and d.model = #{model}</if>
<if test="orderId != null and orderId != ''"> and d.order_id = #{orderId}</if>
</where> </where>
</select> </select>
@@ -110,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null">lot_no,</if> <if test="lotNo != null">lot_no,</if>
<if test="productGuid != null">product_guid,</if> <if test="productGuid != null">product_guid,</if>
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="quantity != null">quantity,</if> <if test="quantity != null">quantity,</if>
<if test="quantityX != null">quantity_x,</if> <if test="quantityX != null">quantity_x,</if>
<if test="quantityJ != null">quantity_j,</if> <if test="quantityJ != null">quantity_j,</if>
@@ -131,11 +138,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="erpStockoutId != null">erp_stockout_id,</if> <if test="erpStockoutId != null">erp_stockout_id,</if>
<if test="unit != null">unit,</if> <if test="unit != null">unit,</if>
<if test="spec != null">spec,</if> <if test="spec != null">spec,</if>
<if test="supplierId != null">supplier_id,</if> <if test="supplierId != null">supplier_id,</if>
<if test="cargoNo != null">cargo_no,</if> <if test="cargoNo != null">cargo_no,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="printDate != null">print_date,</if> <if test="printDate != null">print_date,</if>
<if test="voltage != null">voltage,</if>
<if test="power != null">power,</if>
<if test="phase != null">phase,</if>
<if test="netWeight != null">net_weight,</if>
<if test="grossWeight != null">gross_weight,</if>
<if test="distribution != null">distribution,</if>
<if test="model != null">model,</if>
<if test="orderId != null">order_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutDetailId != null and stockoutDetailId != ''">#{stockoutDetailId},</if> <if test="stockoutDetailId != null and stockoutDetailId != ''">#{stockoutDetailId},</if>
@@ -144,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null">#{lotNo},</if> <if test="lotNo != null">#{lotNo},</if>
<if test="productGuid != null">#{productGuid},</if> <if test="productGuid != null">#{productGuid},</if>
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="quantity != null">#{quantity},</if> <if test="quantity != null">#{quantity},</if>
<if test="quantityX != null">#{quantityX},</if> <if test="quantityX != null">#{quantityX},</if>
<if test="quantityJ != null">#{quantityJ},</if> <if test="quantityJ != null">#{quantityJ},</if>
@@ -165,11 +180,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="erpStockoutId != null">#{erpStockoutId},</if> <if test="erpStockoutId != null">#{erpStockoutId},</if>
<if test="unit != null">#{unit},</if> <if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if> <if test="spec != null">#{spec},</if>
<if test="supplierId != null">#{supplierId},</if> <if test="supplierId != null">#{supplierId},</if>
<if test="cargoNo != null">#{cargoNo},</if> <if test="cargoNo != null">#{cargoNo},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="printDate != null">#{printDate},</if> <if test="printDate != null">#{printDate},</if>
<if test="voltage != null">#{voltage},</if>
<if test="power != null">#{power},</if>
<if test="phase != null">#{phase},</if>
<if test="netWeight != null">#{netWeight},</if>
<if test="grossWeight != null">#{grossWeight},</if>
<if test="distribution != null">#{distribution},</if>
<if test="model != null">#{model},</if>
<if test="orderId != null">#{orderId},</if>
</trim> </trim>
</insert> </insert>
@@ -206,6 +228,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cargoNo != null">cargo_no = #{cargoNo},</if> <if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="printDate != null">print_date = #{printDate},</if> <if test="printDate != null">print_date = #{printDate},</if>
<if test="voltage != null">voltage = #{voltage},</if>
<if test="power != null">power = #{power},</if>
<if test="phase != null">phase = #{phase},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
<if test="distribution != null">distribution = #{distribution},</if>
<if test="model != null">model = #{model},</if>
<if test="orderId != null">order_id = #{orderId},</if>
</trim> </trim>
where stockout_detail_id = #{stockoutDetailId} where stockout_detail_id = #{stockoutDetailId}
</update> </update>
@@ -226,10 +256,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j, d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid, d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date, d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date,
bp.product_name, bp.spare1 as englishDesc, d.voltage, d.power, d.phase, d.net_weight, d.gross_weight, d.distribution, d.model, d.order_id,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume d.product_name
from out_stockout_detail d from out_stockout_detail d
left join bas_product bp on d.product_id = bp.product_id
where d.stockout_guid = #{stockoutGuid} where d.stockout_guid = #{stockoutGuid}
</select> </select>
</mapper> </mapper>

View File

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id
left join bas_customer bc on bc.customer_no = o.customer_no left join bas_customer bc on bc.customer_no = o.customer_no
left join out_stockout_detail d on d.stockout_id = o.stockout_id left join out_stockout_detail d on d.stockout_id = o.stockout_id
left join bas_product bp on bp.product_id = d.product_id
<where> <where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if> <if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and o.stockout_id = #{stockoutId}</if> <if test="stockoutId != null and stockoutId != ''"> and o.stockout_id = #{stockoutId}</if>
@@ -55,17 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="FID != null and FID != ''"> and o.FID = #{FID}</if> <if test="FID != null and FID != ''"> and o.FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if> <if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if>
<if test="productId != null and productId != ''"> and d.product_id = #{productId}</if> <if test="productId != null and productId != ''"> and d.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and bp.product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and d.product_name like concat('%', #{productName}, '%')</if>
<if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if> <if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
<if test="typeData != null and typeData.size()>0">
and bw.warehouse_type in
<foreach item="item" index="index" collection="typeData" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
order by o.create_date desc order by o.create_date desc
</select> </select>

View File

@@ -11,11 +11,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
<result property="quantity" column="quantity" /> <result property="quantity" column="quantity" />
<result property="warehouseId" column="warehouse_id" /> <result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" /> <result property="spare1" column="spare1" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="voltage" column="voltage" />
<result property="power" column="power" />
<result property="phase" column="phase" />
<result property="netWeight" column="net_weight" />
<result property="grossWeight" column="gross_weight" />
<result property="distribution" column="distribution" />
<result property="model" column="model" />
<result property="orderId" column="order_id" />
</resultMap> </resultMap>
<sql id="selectViewProductAndStockVo"> <sql id="selectViewProductAndStockVo">
select only_identity, product_id, lot_no, product_name, quantity, warehouse_id,warehouse_name from view_product_and_stock select only_identity, product_id, lot_no, product_name, quantity, warehouse_id, spare1, spare3, spare4, spare5, spare6, voltage, power, phase, net_weight, gross_weight, distribution, model, order_id from view_product_and_stock
</sql> </sql>
<select id="selectViewProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult"> <select id="selectViewProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult">
@@ -23,10 +35,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if> <if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if> <if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no like concat('%', #{lotNo}, '%')</if> <if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if> <if test="quantity != null "> and quantity = #{quantity}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</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>
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if>
<if test="power != null and power != ''"> and power = #{power}</if>
<if test="phase != null and phase != ''"> and phase = #{phase}</if>
<if test="netWeight != null "> and net_weight = #{netWeight}</if>
<if test="grossWeight != null "> and gross_weight = #{grossWeight}</if>
<if test="distribution != null and distribution != ''"> and distribution = #{distribution}</if>
<if test="model != null and model != ''"> and model = #{model}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
</where> </where>
</select> </select>
@@ -44,6 +69,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">product_name,</if> <if test="productName != null">product_name,</if>
<if test="quantity != null">quantity,</if> <if test="quantity != null">quantity,</if>
<if test="warehouseId != null">warehouse_id,</if> <if test="warehouseId != null">warehouse_id,</if>
<if test="spare1 != null">spare1,</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>
<if test="voltage != null">voltage,</if>
<if test="power != null">power,</if>
<if test="phase != null">phase,</if>
<if test="netWeight != null">net_weight,</if>
<if test="grossWeight != null">gross_weight,</if>
<if test="distribution != null">distribution,</if>
<if test="model != null">model,</if>
<if test="orderId != null">order_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="onlyIdentity != null">#{onlyIdentity},</if> <if test="onlyIdentity != null">#{onlyIdentity},</if>
@@ -52,6 +90,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">#{productName},</if> <if test="productName != null">#{productName},</if>
<if test="quantity != null">#{quantity},</if> <if test="quantity != null">#{quantity},</if>
<if test="warehouseId != null">#{warehouseId},</if> <if test="warehouseId != null">#{warehouseId},</if>
<if test="spare1 != null">#{spare1},</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>
<if test="voltage != null">#{voltage},</if>
<if test="power != null">#{power},</if>
<if test="phase != null">#{phase},</if>
<if test="netWeight != null">#{netWeight},</if>
<if test="grossWeight != null">#{grossWeight},</if>
<if test="distribution != null">#{distribution},</if>
<if test="model != null">#{model},</if>
<if test="orderId != null">#{orderId},</if>
</trim> </trim>
</insert> </insert>
@@ -63,6 +114,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">product_name = #{productName},</if> <if test="productName != null">product_name = #{productName},</if>
<if test="quantity != null">quantity = #{quantity},</if> <if test="quantity != null">quantity = #{quantity},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if> <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="spare1 != null">spare1 = #{spare1},</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>
<if test="voltage != null">voltage = #{voltage},</if>
<if test="power != null">power = #{power},</if>
<if test="phase != null">phase = #{phase},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
<if test="distribution != null">distribution = #{distribution},</if>
<if test="model != null">model = #{model},</if>
<if test="orderId != null">order_id = #{orderId},</if>
</trim> </trim>
where only_identity = #{onlyIdentity} where only_identity = #{onlyIdentity}
</update> </update>

View File

@@ -2,13 +2,23 @@
<div class="app-container"> <div class="app-container">
<!-- 主表信息录入 --> <!-- 主表信息录入 -->
<el-form :model="formData" ref="formRef" size="small" :inline="true" label-width="68px" :rules="rules"> <el-form :model="formData" ref="formRef" size="small" :inline="true" label-width="68px" :rules="rules">
<el-form-item :label="'仓库'" prop="warehouseId" required><!--仓库--> <!-- <el-form-item :label="'仓库'" prop="warehouseId" required>&lt;!&ndash;仓库&ndash;&gt;-->
<el-select v-model="formData.warehouseId" :placeholder="'请选择仓库'" clearable> <!-- <el-select v-model="formData.warehouseId" :placeholder="'请选择仓库'" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in warehouseOptions"-->
<!-- :key="dict.warehouseId"-->
<!-- :label="dict.warehouseName"-->
<!-- :value="dict.warehouseId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item :label="'单据类型'" prop="outType" required><!--单据类型-->
<el-select v-model="formData.outType" :placeholder="'请选择单据类型'" clearable>
<el-option <el-option
v-for="dict in warehouseOptions" v-for="dict in dict.type.out_bill_type"
:key="dict.warehouseId" :key="dict.value"
:label="dict.warehouseName" :label="dict.label"
:value="dict.warehouseId" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -21,16 +31,7 @@
readonly readonly
/> />
</el-form-item> </el-form-item>
<el-form-item :label="'单据类型'" prop="outType" required><!--单据类型-->
<el-select v-model="formData.outType" :placeholder="'请选择单据类型'" clearable>
<el-option
v-for="dict in dict.type.out_bill_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="warning" icon="el-icon-refresh" size="mini" @click="reset">{{'重置'}}<!--重置--></el-button> <el-button type="warning" icon="el-icon-refresh" size="mini" @click="reset">{{'重置'}}<!--重置--></el-button>
<el-button type="success" icon="el-icon-check" size="mini" @click="handleSave" v-hasPermi="['out:outStockout:saveBill']">{{'保存单据'}}<!--保存单据--></el-button> <el-button type="success" icon="el-icon-check" size="mini" @click="handleSave" v-hasPermi="['out:outStockout:saveBill']">{{'保存单据'}}<!--保存单据--></el-button>
@@ -44,14 +45,29 @@
<!-- 物资明细表格 --> <!-- 物资明细表格 -->
<el-table v-loading="loading" :data="materialList"> <el-table v-loading="loading" :data="materialList">
<el-table-column :label="'物资编号'" align="left" prop="productId" /><!--物资编号--> <el-table-column :label="'品号'" align="center" prop="productId" /><!--物资编号-->
<el-table-column :label="'物资名称'" align="left" prop="productName" /><!--物资名称--> <el-table-column :label="'品名'" align="center" prop="productName" /><!--物资名称-->
<el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column label="序列号" align="center" prop="printDate" />
<!-- <el-table-column :label="$t('addOutStockout.batchNo')" align="left" prop="lotNo" />&lt;!&ndash;批号&ndash;&gt;--> <!-- <el-table-column :label="$t('addOutStockout.batchNo')" align="left" prop="lotNo" />&lt;!&ndash;批号&ndash;&gt;-->
<el-table-column :label="'数量'" align="right" prop="quantity"><!--数量--> <el-table-column :label="'数量'" align="center" prop="quantity" width="150"><!--数量-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" /> <el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="型号" align="center" prop="cargoNo" />
<el-table-column label="颜色" align="center" prop="price" />
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
<el-table-column :label="'操作'" align="center" class-name="small-padding fixed-width"><!--操作--> <el-table-column :label="'操作'" align="center" class-name="small-padding fixed-width"><!--操作-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.$index)">{{'删除'}}<!--删除--></el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.$index)">{{'删除'}}<!--删除--></el-button>
@@ -62,22 +78,48 @@
<!-- 选择物资弹窗 --> <!-- 选择物资弹窗 -->
<el-dialog :title="'选择物资'" :visible.sync="materialDialog" width="800px" append-to-body><!--选择物资--> <el-dialog :title="'选择物资'" :visible.sync="materialDialog" width="800px" append-to-body><!--选择物资-->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="'物资编码'" prop="productId"><!--物资编码-->
<el-form-item :label="'品号'" prop="productId"><!--物资编码-->
<el-input <el-input
v-model="queryParams.productId" v-model="queryParams.productId"
:placeholder="'请输入物资编码'" :placeholder="'请输入品号'"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="'物资名称'" prop="productName"><!--物资名称--> <el-form-item :label="'品名'" prop="productName"><!--物资名称-->
<el-input <el-input
v-model="queryParams.productName" v-model="queryParams.productName"
:placeholder="'请输入物资名称'" :placeholder="'请输入品名'"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="规格" prop="spare1">
<el-input v-model="queryParams.spare1" placeholder="请输入规格"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="单位" prop="spare3">
<el-input v-model="queryParams.spare3" placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="型号" prop="spare4">
<el-input v-model="queryParams.spare4" placeholder="请输入型号"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="序列号" prop="spare6">
<el-input v-model="queryParams.spare6" placeholder="请输入序列号"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="订单号" prop="orderId">
<el-input v-model="queryParams.orderId" placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item> <el-form-item>
@@ -88,10 +130,25 @@
<el-table v-loading="materialLoading" :data="materialOptions" @selection-change="handleSelectionChange"> <el-table v-loading="materialLoading" :data="materialOptions" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="'物资编码'" align="left" prop="productId" /><!--物资编码--> <el-table-column label="序号" align="center" prop="onlyIdentity" />
<el-table-column :label="'物资名称'" align="left" prop="productName" /><!--物资名称--> <el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column :label="'数量'" align="right" prop="quantity" /><!--数量--> <el-table-column label="品号" align="center" prop="productId" />
<el-table-column :label="'仓库'" align="left" prop="warehouseId" /><!--仓库--> <el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="品名" align="center" prop="productName" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="仓库" align="center" prop="warehouseId" />
<el-table-column label="规格" align="center" prop="spare1" />
<el-table-column label="单位" align="center" prop="spare3" />
<el-table-column label="型号" align="center" prop="spare4" />
<el-table-column label="颜色" align="center" prop="spare5" />
<el-table-column label="序列号" align="center" prop="spare6" />
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
</el-table> </el-table>
<pagination <pagination
@@ -183,9 +240,9 @@ export default {
customerTotal: 0, customerTotal: 0,
// 表单验证规则 // 表单验证规则
rules: { rules: {
warehouseId: [ // warehouseId: [
{ required: true, message: '请选择仓库', trigger: "change" } // { required: true, message: '请选择仓库', trigger: "change" }
], // ],
customerNo: [ customerNo: [
{ required: true, message: '请输入客户编号', trigger: "blur" } { required: true, message: '请输入客户编号', trigger: "blur" }
], ],
@@ -195,7 +252,7 @@ export default {
}, },
// 主表数据 // 主表数据
formData: { formData: {
warehouseId: null, // warehouseId: null,
customerNo: null, customerNo: null,
customerName: null, // 添加客户名称字段,用于显示 customerName: null, // 添加客户名称字段,用于显示
outType: null outType: null
@@ -219,7 +276,20 @@ export default {
lotNo: null, lotNo: null,
productName: null, productName: null,
quantity: null, quantity: null,
warehouseId: null warehouseId: null,
spare1: null,
spare3: null,
spare4: null,
spare5: null,
spare6: null,
voltage: null,
power: null,
phase: null,
netWeight: null,
grossWeight: null,
distribution: null,
model: null,
orderId: null
}, },
// 客户选择弹窗 // 客户选择弹窗
customerDialog: false, customerDialog: false,
@@ -298,12 +368,12 @@ export default {
}, },
/** 打开选择物资弹窗 */ /** 打开选择物资弹窗 */
handleSelectMaterials() { handleSelectMaterials() {
if (!this.formData.warehouseId) { // if (!this.formData.warehouseId) {
this.$modal.msgError('请选择仓库'); // this.$modal.msgError('请选择仓库');
return; // return;
} // }
this.materialDialog = true; this.materialDialog = true;
this.queryParams.warehouseId = this.formData.warehouseId; // this.queryParams.warehouseId = this.formData.warehouseId;
this.getMaterialList(); this.getMaterialList();
}, },
/** 获取物资列表 */ /** 获取物资列表 */
@@ -341,6 +411,20 @@ export default {
productName: item.productName, productName: item.productName,
quantity: item.quantity, quantity: item.quantity,
quantityOrignal: item.quantity, quantityOrignal: item.quantity,
voltage: item.voltage,
phase: item.phase,
power: item.power,
netWeight: item.netWeight,
grossWeight: item.grossWeight,
distribution: item.distribution,
model: item.model,
orderId: item.orderId,
unit: item.spare3,
spec: item.spare1,
cargoNo: item.spare4,
printDate:item.spare6,
price:item.spare5,
warehouseId: item.warehouseId,
lotNo: item.lotNo, lotNo: item.lotNo,
onlyIdentity: item.onlyIdentity onlyIdentity: item.onlyIdentity
})) }))
@@ -402,7 +486,7 @@ export default {
/** 重置数据 */ /** 重置数据 */
reset() { reset() {
this.formData = { this.formData = {
warehouseId: null, // warehouseId: null,
customerNo: null, customerNo: null,
customerName: null, customerName: null,
outType: null outType: null

View File

@@ -46,37 +46,32 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="'开始时间'" prop="startDate"> <el-form-item :label="'创建时间'" prop="dateRange">
<el-date-picker clearable <el-date-picker
v-model="queryParams.startDate" v-model="dateRange"
type="date" type="datetimerange"
value-format="yyyy-MM-dd" range-separator="---"
:placeholder="'请选择开始时间'"> :start-placeholder="'起始时间'"
</el-date-picker> :end-placeholder="'结束时间'"
</el-form-item> value-format="yyyy-MM-dd HH:mm:ss"
<el-form-item :label="'确认时间'" prop="finishDate"> :default-time="['00:00:00', '23:59:59']"
<el-date-picker clearable
v-model="queryParams.finishDate"
type="date"
value-format="yyyy-MM-dd"
:placeholder="'请选择确认时间'">
</el-date-picker>
</el-form-item>
<el-form-item :label="'仓库'" prop="warehouseId"><!--仓库-->
<el-select
v-model="queryParams.warehouseId"
:placeholder="'请选择仓库'"
clearable
@change="handleQuery"
>
<el-option
v-for="item in warehouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
/> />
</el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="'仓库'" prop="warehouseId">&lt;!&ndash;仓库&ndash;&gt;-->
<!-- <el-select-->
<!-- v-model="queryParams.warehouseId"-->
<!-- :placeholder="'请选择仓库'"-->
<!-- clearable-->
<!-- @change="handleQuery"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in warehouseOptions"-->
<!-- :key="item.warehouseId"-->
<!-- :label="item.warehouseName"-->
<!-- :value="item.warehouseId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}</el-button> <!-- 搜索 --> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{'重置'}}</el-button> <!-- 重置 -->
@@ -151,6 +146,7 @@
<dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/> <dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="'出口'" align="left" prop="exitId" />
<el-table-column :label="'客户编码'" align="left" prop="customerNo" /><!-- 客户编码 --> <el-table-column :label="'客户编码'" align="left" prop="customerNo" /><!-- 客户编码 -->
<el-table-column :label="'客户名称'" align="left" prop="customerName" /> <el-table-column :label="'客户名称'" align="left" prop="customerName" />
<el-table-column :label="'建单人'" align="left" prop="createManId" /> <!-- 建单人 --> <el-table-column :label="'建单人'" align="left" prop="createManId" /> <!-- 建单人 -->
@@ -170,17 +166,28 @@
<!-- 子表数据 --> <!-- 子表数据 -->
<el-table v-loading="detailLoading" :data="outStockDetailList.slice((detailQueryParams.pageNum-1)*detailQueryParams.pageSize, detailQueryParams.pageNum*detailQueryParams.pageSize)" style="margin-top: 20px;"> <el-table v-loading="detailLoading" :data="outStockDetailList.slice((detailQueryParams.pageNum-1)*detailQueryParams.pageSize, detailQueryParams.pageNum*detailQueryParams.pageSize)" style="margin-top: 20px;">
<el-table-column :label="'出库子单编号'" align="left" prop="stockoutDetailId" /> <!-- 出库子单编号 --> <el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" /> <!-- 出库子单编号 -->
<el-table-column :label="'物资编码'" align="left" prop="productId" /> <!-- 物资编码 --> <el-table-column :label="'品号'" align="center" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="'物资描述'" align="left" prop="extraField.materialDesc" /> <el-table-column :label="'品名'" align="center" prop="productName" />
<el-table-column :label="'英文描述'" align="left" prop="extraField.englishDesc"/><!--英文描述--> <el-table-column :label="'批次号'" align="center" prop="lotNo"/><!--英文描述-->
<el-table-column :label="'箱号'" align="left" prop="extraField.cartonNo"/><!--箱号--> <el-table-column :label="'序列号'" align="center" prop="printDate" /> <!--序列号-->
<el-table-column :label="'包装方式'" align="left" prop="extraField.packingMethod"/><!--包装方式--> <el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column :label="'净重'" align="right" width="120px" prop="extraField.netWeight" /> <!--净重--> <el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 -->
<el-table-column :label="'计划数量'" align="right" prop="quantity" /> <!-- 计划数量 --> <el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 -->
<el-table-column :label="'实际数量'" align="right" prop="assignNum" /> <!-- 实际数量 --> <el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 -->
<el-table-column :label="'分配数量'" align="right" prop="allotQuantity" /> <!-- 分配数量 --> <el-table-column :label="'颜色'" align="center" prop="price"/><!--箱号-->
<el-table-column :label="'备注'" align="left" prop="remark" /> <!-- 备注 --> <el-table-column :label="'单位'" align="center" prop="unit"/><!--单位-->
<el-table-column :label="'规格'" align="center" prop="spec" /> <!--规格-->
<el-table-column :label="'型号'" align="center" prop="cargoNo" /> <!--型号-->
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
->
<el-table-column :label="'备注'" align="center" prop="remark" /> <!-- 备注 -->
</el-table> </el-table>
<pagination <pagination
@@ -250,27 +257,16 @@ export default {
] ]
}, },
// 出口选项 // 出口选项
exitOptions: [], exitOptions: [
// 所有出口数据(按仓库ID分组) { exitId: 'G1001', exitName: 'G1001'},
allExitOptions: { { exitId: 'G1002', exitName: 'G1002'},
'02': [
{ exitId: "G1004", exitName: 'G1004' },
{ exitId: 'G1010', exitName: 'G1010' },
{ exitId: 'fluent1', exitName: 'fluent1' },
{ exitId: 'fluent2', exitName: 'fluent2' },
], ],
'13': [
{ exitId: 'G2001', exitName: 'G2001' },
{ exitId: 'G3001', exitName: 'G3001' },
{ exitId: 'G3010', exitName: 'G3010' },
{ exitId: 'G4001', exitName: 'G4001' },
{ exitId: 'G4010', exitName: 'G4010' },
{ exitId: 'G5001', exitName: 'G5001' },
{ exitId: 'G5010', exitName: 'G5010' },
]
},
// 当前审核状态 // 当前审核状态
currentAuditStatus: null, currentAuditStatus: null,
// 日期范围
dateRange: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@@ -346,6 +342,14 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
// 处理日期范围
if (this.dateRange && this.dateRange.length > 0) {
this.queryParams.startDate = this.dateRange[0]
this.queryParams.finishDate = this.dateRange[1]
} else {
this.queryParams.startDate = null
this.queryParams.finishDate = null
}
// 清空子表数据 // 清空子表数据
this.outStockDetailList = [] this.outStockDetailList = []
this.detailTotal = 0 this.detailTotal = 0
@@ -355,6 +359,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []
this.resetForm("queryForm") this.resetForm("queryForm")
this.handleQuery() this.handleQuery()
}, },
@@ -374,26 +379,27 @@ export default {
} }
for(var i=0;i<this.selectedRows.length;i++){ for(var i=0;i<this.selectedRows.length;i++){
if (this.selectedRows[i].status != "1" && status == "2") { if (this.selectedRows[i].status != "1" && status == 2) {
this.$modal.msgError(this.selectedRows[i].stockoutId+'单据已审核') this.$modal.msgError(this.selectedRows[i].stockoutId+'单据已审核')
return return
} }
// if (this.selectedRows[i].status < 3 && status == "4") { if (Number(this.selectedRows[i].status) < 3 && status == 4) {
// this.$modal.msgError(this.selectedRows[i].stockoutId+"单据未开始,无法确认") this.$modal.msgError(this.selectedRows[i].stockoutId+"单据未开始,无法确认")
// return return
// } }
if (this.selectedRows[i].status != "1" && status == "5"){ if (this.selectedRows[i].status != "1" && status == 5){
this.$modal.msgError(this.selectedRows[i].stockoutId+'单据已审核,无法作废') this.$modal.msgError(this.selectedRows[i].stockoutId+'单据已审核,无法作废')
return; return;
} }
} }
// 如果是审核操作(status=2),显示弹窗选择出口 // 如果是审核操作(status=2),显示弹窗选择出口
if (status === 2 || status === 3) { if (status === 2 || status === 3) {
this.currentAuditStatus = status this.currentAuditStatus = status
// 根据选中单据的仓库ID设置出口选项
this.setExitOptionsByWarehouse()
this.auditDialogVisible = true this.auditDialogVisible = true
this.auditForm.exitId = null this.auditForm.exitId = null
return return
@@ -425,9 +431,7 @@ export default {
} }
const stockoutIds = this.selectedRows.map(row => row.stockoutId) const stockoutIds = this.selectedRows.map(row => row.stockoutId)
let outstock = this.selectedRows[0] let outstock = this.selectedRows[0]
console.log(outstock.status !== "2") if (outstock.status != "2" && outstock.status != "3") {
console.log(outstock.status !== "3")
if (outstock.status !== "2" && outstock.status !== "3") {
this.$modal.msgError('请先审核出库单') this.$modal.msgError('请先审核出库单')
return return
} }
@@ -486,49 +490,7 @@ export default {
this.currentAuditStatus = null this.currentAuditStatus = null
}, },
/** 根据仓库ID设置出口选项 */
setExitOptionsByWarehouse() {
try {
// 获取选中单据的仓库ID集合,过滤掉空值和无效值
const warehouseIds = [...new Set(
this.selectedRows
.map(row => row.warehouseId)
.filter(id => id !== null && id !== undefined && id !== '')
)]
//console.log("仓库ID集合:", warehouseIds)
// 如果没有有效的仓库ID,清空出口选项
if (warehouseIds.length === 0) {
this.exitOptions = []
//console.warn('没有找到有效的仓库ID,已清空出口选项')
return
}
if (warehouseIds.length === 1) {
// 如果所有选中单据都是同一个仓库,显示该仓库的出口
const warehouseId = warehouseIds[0]
this.exitOptions = this.allExitOptions[warehouseId] || []
// 如果没有对应key的默认为空数组,并给出提示
if (!this.allExitOptions[warehouseId]) {
//console.warn(`仓库ID ${warehouseId} 没有配置出口选项,已设置为空数组`)
}
}
console.log('选中仓库ID:', warehouseIds, '可用出口:', this.exitOptions)
// 如果最终没有可用的出口选项,给出提示
if (this.exitOptions.length === 0) {
this.exitOptions=[{exitId: '0', exitName: '人工出口'}]
}
} catch (error) {
console.error('设置出口选项时发生错误:', error)
// 发生错误时,设置为空数组,确保不会影响用户操作
this.exitOptions = []
}
}
} }
} }
</script> </script>