From bd11b2eec2c8086e910e177350fbfb8f44822c46 Mon Sep 17 00:00:00 2001 From: xs Date: Tue, 13 Aug 2024 18:59:23 +0800 Subject: [PATCH] =?UTF-8?q?2.9.3=20WMS:=20=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=92=8C=E6=88=90=E5=93=81=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/WmsConstants.java | 2 + .../wms/controller/WmsRawStockController.java | 2 +- .../controller/WmsStockTotalController.java | 17 +- .../com/hw/wms/domain/WmsBaseWarehouse.java | 11 + .../com/hw/wms/domain/WmsProductStock.java | 30 ++ .../java/com/hw/wms/domain/WmsRawStock.java | 20 + .../java/com/hw/wms/domain/WmsStockTotal.java | 19 + .../com/hw/wms/mapper/WmsRawStockMapper.java | 9 + .../hw/wms/mapper/WmsStockTotalMapper.java | 8 + .../hw/wms/service/IWmsRawStockService.java | 8 + .../hw/wms/service/IWmsStockTotalService.java | 8 + .../impl/WmsProductStockServiceImpl.java | 7 + .../service/impl/WmsRawStockServiceImpl.java | 22 ++ .../impl/WmsStockTotalServiceImpl.java | 13 + .../mapper/wms/WmsBaseWarehouseMapper.xml | 1 + .../mapper/wms/WmsProductStockMapper.xml | 14 +- .../mapper/wms/WmsRawStockMapper.xml | 67 ++++ .../mapper/wms/WmsStockTotalMapper.xml | 48 ++- hw-ui/src/api/wms/wmslocation.js | 2 +- hw-ui/src/views/wms/info/stocktotal/index.vue | 374 ++++++++---------- 20 files changed, 455 insertions(+), 227 deletions(-) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java index b97b071..396dd01 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java @@ -247,4 +247,6 @@ public class WmsConstants { //原材料出库拆分标识 public static final String WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES = "1"; + public static final String WMS_SAFE_FLAG_YES = "1";//安全库存,是 + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawStockController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawStockController.java index 3f45fd3..21119ea 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawStockController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsRawStockController.java @@ -46,7 +46,7 @@ public class WmsRawStockController extends BaseController public TableDataInfo list(WmsRawStock wmsRawStock) { startPage(); - List list = wmsRawStockService.selectWmsRawStockList(wmsRawStock); + List list = wmsRawStockService.selectWmsRawStockJoinList(wmsRawStock); return getDataTable(list); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java index 671b32a..6d7a36c 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java @@ -4,6 +4,9 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson2.JSONObject; +import com.hw.common.core.constant.WmsConstants; +import com.hw.wms.domain.WmsBaseWarehouse; +import com.hw.wms.service.IWmsBaseWarehouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -36,6 +39,9 @@ public class WmsStockTotalController extends BaseController @Autowired private IWmsStockTotalService wmsStockTotalService; + @Autowired + private IWmsBaseWarehouseService wmsBaseWarehouseService; + /** * 查询原材料/成品库存列表 */ @@ -44,10 +50,19 @@ public class WmsStockTotalController extends BaseController public TableDataInfo list(WmsStockTotal wmsStockTotal) { startPage(); - List list = wmsStockTotalService.selectWmsStockTotalList(wmsStockTotal); + List list = wmsStockTotalService.selectWmsStockTotalJoinList(wmsStockTotal); return getDataTable(list); } + @RequiresPermissions("wms:stocktotal:list") + @GetMapping("/getWarehouses") + public AjaxResult list(WmsBaseWarehouse wmsBaseWarehouse) { + wmsBaseWarehouse.setActiveFlag(WmsConstants.WMS_WAREHOUSE_ACTIVE_FLAG_YES); + List list = wmsBaseWarehouseService.selectWmsBaseWarehouseList(wmsBaseWarehouse); + return success(list); + } + + /** * 导出原材料/成品库存列表 */ diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsBaseWarehouse.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsBaseWarehouse.java index a8b72fe..a3c3349 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsBaseWarehouse.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsBaseWarehouse.java @@ -175,6 +175,9 @@ public class WmsBaseWarehouse extends BaseEntity { @Excel(name = "是否按照线体入库 0否 1是") private String lineFlag; + private String warehouseInstockTypeStr; + + /** * 库位信息 */ @@ -425,6 +428,14 @@ public class WmsBaseWarehouse extends BaseEntity { this.mesAreaType = mesAreaType; } + public String getWarehouseInstockTypeStr() { + return warehouseInstockTypeStr; + } + + public void setWarehouseInstockTypeStr(String warehouseInstockTypeStr) { + this.warehouseInstockTypeStr = warehouseInstockTypeStr; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductStock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductStock.java index 3f0820c..d8bff4d 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductStock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductStock.java @@ -114,6 +114,12 @@ public class WmsProductStock extends BaseEntity private BigDecimal applyAmount; + private String materialSpec; + + private String safeFlag; + + private String stockTypeStr; + public void setProductStockId(Long productStockId) { this.productStockId = productStockId; @@ -332,6 +338,30 @@ public class WmsProductStock extends BaseEntity this.applyAmount = applyAmount; } + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + public String getSafeFlag() { + return safeFlag; + } + + public void setSafeFlag(String safeFlag) { + this.safeFlag = safeFlag; + } + + public String getStockTypeStr() { + return stockTypeStr; + } + + public void setStockTypeStr(String stockTypeStr) { + this.stockTypeStr = stockTypeStr; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawStock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawStock.java index 734309c..0536e13 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawStock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawStock.java @@ -157,6 +157,10 @@ public class WmsRawStock extends BaseEntity { @Excel(name = "有效标记") private String activeFlag; + private String materialSpec; + + private String saleorderCode; + public String getWarehouseName() { return warehouseName; } @@ -354,6 +358,22 @@ public class WmsRawStock extends BaseEntity { ",安全库存:"+(safeFlag!=null && safeFlag.equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES)?"是":"否")+";"; } + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + public String getSaleorderCode() { + return saleorderCode; + } + + public void setSaleorderCode(String saleorderCode) { + this.saleorderCode = saleorderCode; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsStockTotal.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsStockTotal.java index 9d08787..a329031 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsStockTotal.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsStockTotal.java @@ -118,6 +118,9 @@ public class WmsStockTotal extends BaseEntity { private String planDetailCode; + private String saleorderCode; + + private String stockTypeStr; public String getWarehouseName() { return warehouseName; @@ -288,6 +291,22 @@ public class WmsStockTotal extends BaseEntity { this.planDetailCode = planDetailCode; } + public String getSaleorderCode() { + return saleorderCode; + } + + public void setSaleorderCode(String saleorderCode) { + this.saleorderCode = saleorderCode; + } + + public String getStockTypeStr() { + return stockTypeStr; + } + + public void setStockTypeStr(String stockTypeStr) { + this.stockTypeStr = stockTypeStr; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawStockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawStockMapper.java index 466747a..e66e26e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawStockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawStockMapper.java @@ -100,4 +100,13 @@ public interface WmsRawStockMapper { * @return 原材料库存集合 */ public List selectOnlyWmsRawStockInList(WmsRawStock wmsRawStock); + + /** + * 查询原材料库存列表,join warehouse,material,saleorder + * + * @param wmsRawStock 原材料库存 + * @return 原材料库存集合 + */ + public List selectWmsRawStockJoinList(WmsRawStock wmsRawStock); + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java index f5330c9..d3c62f2 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java @@ -80,4 +80,12 @@ public interface WmsStockTotalMapper */ public List selectWmsStockTotalJoinRealListBySaleOrder(WmsStockTotal wmsStockTotal); + + /** + * 查询原材料库存列表,Join warehouse,material,sale_order + * + * @param wmsStockTotal 原材料库存 + * @return 原材料库存集合 + */ + public List selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawStockService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawStockService.java index ccf716c..3bc4e2d 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawStockService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawStockService.java @@ -26,6 +26,14 @@ public interface IWmsRawStockService * @return 原材料库存集合 */ public List selectWmsRawStockList(WmsRawStock wmsRawStock); +; + /** + * 查询原材料库存列表join warehouse,material,saleorder + * + * @param wmsRawStock 原材料库存 + * @return 原材料库存 + */ + public List selectWmsRawStockJoinList(WmsRawStock wmsRawStock); /** * 新增原材料库存 diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java index 011ad56..fcbadc0 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java @@ -31,6 +31,14 @@ public interface IWmsStockTotalService */ public List selectWmsStockTotalList(WmsStockTotal wmsStockTotal); + /** + * 查询原材料库存列表,Join warehouse,material,sale_order + * + * @param wmsStockTotal 原材料库存 + * @return 原材料库存 + */ + public List selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal); + /** * 新增原材料库存 * diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductStockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductStockServiceImpl.java index 15955fd..2d8e6dc 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductStockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductStockServiceImpl.java @@ -6,7 +6,9 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.StringUtils; import com.hw.wms.controller.WmsProductStockController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -44,6 +46,11 @@ public class WmsProductStockServiceImpl implements IWmsProductStockService { */ @Override public List selectWmsProductStockList(WmsProductStock wmsProductStock) { + String safeFlag = wmsProductStock.getSafeFlag(); + if(StringUtils.isNotEmpty(safeFlag) && safeFlag.equals(WmsConstants.WMS_SAFE_FLAG_YES)){ + wmsProductStock.setSaleOrderId(0L); + wmsProductStock.setSafeFlag(null); + } return wmsProductStockMapper.selectWmsProductStockList(wmsProductStock); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawStockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawStockServiceImpl.java index e99fcef..61fc480 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawStockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawStockServiceImpl.java @@ -2,6 +2,8 @@ package com.hw.wms.service.impl; import java.util.List; +import com.hw.common.core.constant.WmsConstants; +import com.hw.common.core.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.wms.mapper.WmsRawStockMapper; @@ -43,6 +45,25 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService { return wmsRawStocks; } + + /** + * 查询原材料库存列表join warehouse,material,saleorder + * + * @param wmsRawStock 原材料库存 + * @return 原材料库存 + */ + @Override + public List selectWmsRawStockJoinList(WmsRawStock wmsRawStock) { + String safeFlag = wmsRawStock.getSafeFlag(); + if (StringUtils.isNotEmpty(safeFlag) && safeFlag.equals(WmsConstants.WMS_SAFE_FLAG_YES)) { + wmsRawStock.setSaleOrderId(0L); + wmsRawStock.setSafeFlag(null); + } + List wmsRawStocks = wmsRawStockMapper.selectWmsRawStockJoinList(wmsRawStock); + ; + return wmsRawStocks; + } + /** * 新增原材料库存 * @@ -102,6 +123,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService { /** * 根据物料ID校验库存 + * * @param wmsRawStock * @return */ diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java index 0309802..c123abd 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java @@ -49,6 +49,19 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService return wmsStockTotalMapper.selectWmsStockTotalList(wmsStockTotal); } + /** + * 查询原材料库存列表,Join warehouse,material,sale_order + * + * @param wmsStockTotal 原材料库存 + * @return 原材料库存 + */ + @Override + public List selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal) + { + return wmsStockTotalMapper.selectWmsStockTotalJoinList(wmsStockTotal); + } + + /** * 新增原材料库存 * diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseWarehouseMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseWarehouseMapper.xml index 0f68a57..0461cb3 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseWarehouseMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseWarehouseMapper.xml @@ -84,6 +84,7 @@ and warehouse_id = #{warehouseId} and warehouse_instock_type = #{warehouseInstockType} + and warehouse_instock_type in ('2','3') and warehouse_type = #{warehouseType} and warehouse_code = #{warehouseCode} and warehouse_name like concat('%', #{warehouseName}, '%') diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml index dce9ef3..ce390b5 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml @@ -29,6 +29,7 @@ + @@ -47,6 +48,7 @@ wps.product_id, mbmi.material_code, mbmi.material_name, + mbmi.material_spec, wps.plan_code, wps.plan_detail_code, wps.sale_order_id, @@ -71,15 +73,19 @@ and wps.warehouse_id = #{warehouseId} and wps.location_code = #{locationCode} and wps.stock_type = #{stockType} + and wps.stock_type in ('2','3') and wps.product_batch = #{productBatch} and wps.quality_status = #{qualityStatus} and wps.product_id = #{productId} and wps.plan_code = #{planCode} and wps.plan_detail_code = #{planDetailCode} - and wps.saleorder_code = #{saleorderCode} - and wps.total_amount = #{totalAmount} - and wps.frozen_amount = #{frozenAmount} - and wps.occupy_amount = #{occupyAmount} + and mbmi.material_code like concat('%', #{materialCode}, '%') + and mbmi.material_name like concat('%', #{materialName}, '%') + and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') + and wps.sale_order_id = #{saleOrderId} + and wps.sale_order_id !=0 + and wps.saleorder_code like concat('%', #{saleorderCode}, '%') and wps.update_date = #{updateDate} and wps.active_flag = #{activeFlag} and wps.instock_date = #{instockDate} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index 08a9482..29237dd 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -30,7 +30,9 @@ + + @@ -43,6 +45,7 @@ wrs.material_id, mbmi.material_code, mbmi.material_name, + mbmi.material_spec, wrs.instock_batch, wrs.pallet_info_code, wrs.sale_order_id, @@ -282,4 +285,68 @@ + + + diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index 7dd9952..ac9bcda 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -25,6 +25,7 @@ + @@ -59,9 +60,6 @@ and wst.material_id = #{materialId} and wst.sale_order_id = #{saleOrderId} and wst.safe_flag = #{safeFlag} - and wst.total_amount = #{totalAmount} - and wst.frozen_amount = #{frozenAmount} - and wst.occupy_amount = #{occupyAmount} and wst.create_date = #{createDate} and wst.update_date = #{updateDate} and wst.active_flag = #{activeFlag} @@ -194,4 +192,48 @@ + + diff --git a/hw-ui/src/api/wms/wmslocation.js b/hw-ui/src/api/wms/wmslocation.js index 9b30e41..bba5e86 100644 --- a/hw-ui/src/api/wms/wmslocation.js +++ b/hw-ui/src/api/wms/wmslocation.js @@ -46,7 +46,7 @@ export function delWmslocation(locationId) { // 查询仓库列表 export function getWarehouses(query) { return request({ - url: '/wms/wmslocation/getWarehouses', + url: '/wms/stocktotal/getWarehouses', method: 'get', params: query }) diff --git a/hw-ui/src/views/wms/info/stocktotal/index.vue b/hw-ui/src/views/wms/info/stocktotal/index.vue index 6126b5c..325d30a 100644 --- a/hw-ui/src/views/wms/info/stocktotal/index.vue +++ b/hw-ui/src/views/wms/info/stocktotal/index.vue @@ -32,15 +32,54 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + 搜索 @@ -58,79 +97,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 导出 - - - - - - + - - + + + + + + - - - - - - - - - - + + + + + + + + + + 库位库存明细信息 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -264,6 +204,7 @@ import {getWarehouses} from "@//api/wms/wmslocation"; export default { name: "Stocktotal", + dicts: ['mes_safe_flag', 'wms_stock_complete_flag'], data() { return { // 遮罩层 @@ -302,11 +243,15 @@ export default { // 查询参数 queryParams: { pageNum: 1, - pageSize: 2, + pageSize: 10, warehouseId: null, warehouseFloor: null, - stockType: null, materialId: null, + materialCode: null, + materialName: null, + materialSpec: null, + saleorderCode: null, + safeFlag: null, totalAmount: null, frozenAmount: null, occupyAmount: null, @@ -316,7 +261,7 @@ export default { }, queryTwoParams: { pageNum: 1, - pageSize: 2 + pageSize: 10 }, // 表单参数 form: {}, @@ -324,48 +269,68 @@ export default { rawstockList: [], // 显示列 columns: [], + STOCK_TYPE: { + RAW: "1", + SEMI: "2", + PRODUCT: "3", + } }; }, + watch: { + // 根据名称筛选仓库 + warehouseName(val) { + this.$refs.tree.filter(val); + } + }, + created() { this.type = this.$route.query && this.$route.query.type; - if (this.type === '1') { + if (this.type === this.STOCK_TYPE.RAW) { + this.queryParams.stockType = this.STOCK_TYPE.RAW; this.columns = [ {key: 0, label: `仓库名称`, visible: true}, {key: 1, label: `仓库楼层`, visible: true}, {key: 2, label: `库位编码`, visible: true}, - {key: 3, label: `物料编号`, visible: true}, + {key: 3, label: `物料编码`, visible: true}, {key: 4, label: `物料名称`, visible: true}, - {key: 5, label: `入库批次号`, visible: true}, - {key: 6, label: `托盘RFID代码`, visible: true}, + {key: 5, label: `物料条码`, visible: true}, + {key: 6, label: `托盘码`, visible: true}, {key: 7, label: `总数量`, visible: true}, {key: 8, label: `占用数量`, visible: true}, {key: 9, label: `创建时间`, visible: true}, {key: 10, label: `成品编号`, visible: false}, {key: 11, label: `成品名称`, visible: false}, - {key: 12, label: `计划编号`, visible: false}, - {key: 13, label: `计划明细编号`, visible: false}, - {key: 14, label: `销售订单编号`, visible: false}, + {key: 12, label: `派工单号`, visible: false}, + {key: 13, label: `生产明细编号`, visible: false}, + {key: 14, label: `销售订单`, visible: true}, + {key: 15, label: `安全库存`, visible: true}, + {key: 16, label: `物料规格`, visible: true}, + {key: 17, label: `完整标识`, visible: true}, ] } - if (this.type === '3') { + if (this.type === this.STOCK_TYPE.PRODUCT) { + this.queryParams.stockTypeStr = this.STOCK_TYPE.SEMI +","+ this.STOCK_TYPE.PRODUCT; this.columns = [ {key: 0, label: `仓库名称`, visible: true}, {key: 1, label: `仓库楼层`, visible: true}, {key: 2, label: `库位编码`, visible: true}, - {key: 3, label: `物料编号`, visible: false}, - {key: 4, label: `物料名称`, visible: false}, - {key: 5, label: `入库批次号`, visible: false}, - {key: 6, label: `托盘RFID代码`, visible: true}, + {key: 3, label: `物料编码`, visible: true}, + {key: 4, label: `物料名称`, visible: true}, + {key: 5, label: `物料条码`, visible: true}, + {key: 6, label: `托盘码`, visible: true}, {key: 7, label: `总数量`, visible: true}, {key: 8, label: `占用数量`, visible: true}, {key: 9, label: `创建时间`, visible: true}, - {key: 10, label: `成品编号`, visible: true}, - {key: 11, label: `成品名称`, visible: true}, - {key: 12, label: `计划编号`, visible: true}, - {key: 13, label: `计划明细编号`, visible: true}, - {key: 14, label: `销售订单编号`, visible: true}, + {key: 10, label: `成品编号`, visible: false}, + {key: 11, label: `成品名称`, visible: false}, + {key: 12, label: `派工单号`, visible: true}, + {key: 13, label: `生产明细编号`, visible: false}, + {key: 14, label: `销售订单`, visible: true}, + {key: 15, label: `安全库存`, visible: true}, + {key: 16, label: `物料规格`, visible: true}, + {key: 17, label: `完整标识`, visible: false}, ] } this.getWarehouseList(); @@ -386,19 +351,20 @@ export default { /** 查询库位库存明细列表 */ getTwoList() { this.loadingTwo = true; - this.queryTwoParams.params = {}; - if (null != this.daterangeCreateDate && '' != this.daterangeCreateDate) { - this.queryTwoParams.params["beginCreateDate"] = this.daterangeCreateDate[0]; - this.queryTwoParams.params["endCreateDate"] = this.daterangeCreateDate[1]; - } - if (this.type === '1') { + this.queryTwoParams = this.queryParams; + // if (null != this.daterangeCreateDate && '' != this.daterangeCreateDate) { + // this.queryTwoParams.params["beginCreateDate"] = this.daterangeCreateDate[0]; + // this.queryTwoParams.params["endCreateDate"] = this.daterangeCreateDate[1]; + // } + + if (this.type === this.STOCK_TYPE.RAW) { listRawstock(this.queryTwoParams).then(response => { this.rawstockList = response.rows; this.twoPTotal = response.total; this.loadingTwo = false; }); } - if (this.type === '3') { + if (this.type === this.STOCK_TYPE.PRODUCT) { listProductstock(this.queryTwoParams).then(response => { this.rawstockList = response.rows; this.twoPTotal = response.total; @@ -439,7 +405,10 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + this.queryParams.warehouseId = null; + this.queryTwoParams.warehouseId = null; this.resetForm("queryForm"); + this.$refs.tree.setCurrentKey(null); this.handleQuery(); }, // 多选框选中数据 @@ -448,12 +417,6 @@ export default { this.single = selection.length !== 1 this.multiple = !selection.length }, - /** 新增按钮操作 */ - handleAdd() { - this.reset(); - this.open = true; - this.title = "添加原材料库存"; - }, // 筛选节点 filterNode(value, data) { @@ -471,7 +434,14 @@ export default { getWarehouseList() { this.loading = true; this.loadingTwo = true; - getWarehouses({warehouseInstockType: this.type}).then(response => { + let query; + if(this.type === this.STOCK_TYPE.RAW){ + query = {warehouseInstockType: this.type} + }else if(this.type===this.STOCK_TYPE.PRODUCT){ + query = {warehouseInstockTypeStr: this.STOCK_TYPE.SEMI+","+this.STOCK_TYPE.PRODUCT} + } + + getWarehouses(query).then(response => { this.warehouseList = response.data; // this.queryParams.warehouseId = this.warehouseList[0].warehouseId; // this.queryTwoParams.warehouseId = this.warehouseList[0].warehouseId; @@ -480,36 +450,6 @@ export default { }); }, - /** 修改按钮操作 */ - handleUpdate(row) { - this.reset(); - const stockTotalId = row.stockTotalId || this.ids - getStocktotal(stockTotalId).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改原材料库存"; - }); - }, - /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (valid) { - if (this.form.stockTotalId != null) { - updateStocktotal(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addStocktotal(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); - }, /** 删除按钮操作 */ handleDelete(row) {