WMS:
原材料库存和成品库存查询优化
master
xs 3 months ago
parent baa366a81a
commit bd11b2eec2

@ -247,4 +247,6 @@ public class WmsConstants {
//原材料出库拆分标识 //原材料出库拆分标识
public static final String WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES = "1"; public static final String WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES = "1";
public static final String WMS_SAFE_FLAG_YES = "1";//安全库存,是
} }

@ -46,7 +46,7 @@ public class WmsRawStockController extends BaseController
public TableDataInfo list(WmsRawStock wmsRawStock) public TableDataInfo list(WmsRawStock wmsRawStock)
{ {
startPage(); startPage();
List<WmsRawStock> list = wmsRawStockService.selectWmsRawStockList(wmsRawStock); List<WmsRawStock> list = wmsRawStockService.selectWmsRawStockJoinList(wmsRawStock);
return getDataTable(list); return getDataTable(list);
} }

@ -4,6 +4,9 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONObject; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -36,6 +39,9 @@ public class WmsStockTotalController extends BaseController
@Autowired @Autowired
private IWmsStockTotalService wmsStockTotalService; private IWmsStockTotalService wmsStockTotalService;
@Autowired
private IWmsBaseWarehouseService wmsBaseWarehouseService;
/** /**
* / * /
*/ */
@ -44,10 +50,19 @@ public class WmsStockTotalController extends BaseController
public TableDataInfo list(WmsStockTotal wmsStockTotal) public TableDataInfo list(WmsStockTotal wmsStockTotal)
{ {
startPage(); startPage();
List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalList(wmsStockTotal); List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalJoinList(wmsStockTotal);
return getDataTable(list); return getDataTable(list);
} }
@RequiresPermissions("wms:stocktotal:list")
@GetMapping("/getWarehouses")
public AjaxResult list(WmsBaseWarehouse wmsBaseWarehouse) {
wmsBaseWarehouse.setActiveFlag(WmsConstants.WMS_WAREHOUSE_ACTIVE_FLAG_YES);
List<WmsBaseWarehouse> list = wmsBaseWarehouseService.selectWmsBaseWarehouseList(wmsBaseWarehouse);
return success(list);
}
/** /**
* / * /
*/ */

@ -175,6 +175,9 @@ public class WmsBaseWarehouse extends BaseEntity {
@Excel(name = "是否按照线体入库 0否 1是") @Excel(name = "是否按照线体入库 0否 1是")
private String lineFlag; private String lineFlag;
private String warehouseInstockTypeStr;
/** /**
* *
*/ */
@ -425,6 +428,14 @@ public class WmsBaseWarehouse extends BaseEntity {
this.mesAreaType = mesAreaType; this.mesAreaType = mesAreaType;
} }
public String getWarehouseInstockTypeStr() {
return warehouseInstockTypeStr;
}
public void setWarehouseInstockTypeStr(String warehouseInstockTypeStr) {
this.warehouseInstockTypeStr = warehouseInstockTypeStr;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -114,6 +114,12 @@ public class WmsProductStock extends BaseEntity
private BigDecimal applyAmount; private BigDecimal applyAmount;
private String materialSpec;
private String safeFlag;
private String stockTypeStr;
public void setProductStockId(Long productStockId) public void setProductStockId(Long productStockId)
{ {
this.productStockId = productStockId; this.productStockId = productStockId;
@ -332,6 +338,30 @@ public class WmsProductStock extends BaseEntity
this.applyAmount = applyAmount; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -157,6 +157,10 @@ public class WmsRawStock extends BaseEntity {
@Excel(name = "有效标记") @Excel(name = "有效标记")
private String activeFlag; private String activeFlag;
private String materialSpec;
private String saleorderCode;
public String getWarehouseName() { public String getWarehouseName() {
return warehouseName; return warehouseName;
} }
@ -354,6 +358,22 @@ public class WmsRawStock extends BaseEntity {
",安全库存:"+(safeFlag!=null && safeFlag.equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES)?"是":"否")+";"; ",安全库存:"+(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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -118,6 +118,9 @@ public class WmsStockTotal extends BaseEntity {
private String planDetailCode; private String planDetailCode;
private String saleorderCode;
private String stockTypeStr;
public String getWarehouseName() { public String getWarehouseName() {
return warehouseName; return warehouseName;
@ -288,6 +291,22 @@ public class WmsStockTotal extends BaseEntity {
this.planDetailCode = planDetailCode; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -100,4 +100,13 @@ public interface WmsRawStockMapper {
* @return * @return
*/ */
public List<WmsRawStock> selectOnlyWmsRawStockInList(WmsRawStock wmsRawStock); public List<WmsRawStock> selectOnlyWmsRawStockInList(WmsRawStock wmsRawStock);
/**
* join warehousematerialsaleorder
*
* @param wmsRawStock
* @return
*/
public List<WmsRawStock> selectWmsRawStockJoinList(WmsRawStock wmsRawStock);
} }

@ -80,4 +80,12 @@ public interface WmsStockTotalMapper
*/ */
public List<WmsStockTotal> selectWmsStockTotalJoinRealListBySaleOrder(WmsStockTotal wmsStockTotal); public List<WmsStockTotal> selectWmsStockTotalJoinRealListBySaleOrder(WmsStockTotal wmsStockTotal);
/**
* ,Join warehouse,material,sale_order
*
* @param wmsStockTotal
* @return
*/
public List<WmsStockTotal> selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal);
} }

@ -26,6 +26,14 @@ public interface IWmsRawStockService
* @return * @return
*/ */
public List<WmsRawStock> selectWmsRawStockList(WmsRawStock wmsRawStock); public List<WmsRawStock> selectWmsRawStockList(WmsRawStock wmsRawStock);
;
/**
* join warehousematerialsaleorder
*
* @param wmsRawStock
* @return
*/
public List<WmsRawStock> selectWmsRawStockJoinList(WmsRawStock wmsRawStock);
/** /**
* *

@ -31,6 +31,14 @@ public interface IWmsStockTotalService
*/ */
public List<WmsStockTotal> selectWmsStockTotalList(WmsStockTotal wmsStockTotal); public List<WmsStockTotal> selectWmsStockTotalList(WmsStockTotal wmsStockTotal);
/**
* ,Join warehouse,material,sale_order
*
* @param wmsStockTotal
* @return
*/
public List<WmsStockTotal> selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal);
/** /**
* *
* *

@ -6,7 +6,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.StringUtils;
import com.hw.wms.controller.WmsProductStockController; import com.hw.wms.controller.WmsProductStockController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -44,6 +46,11 @@ public class WmsProductStockServiceImpl implements IWmsProductStockService {
*/ */
@Override @Override
public List<WmsProductStock> selectWmsProductStockList(WmsProductStock wmsProductStock) { public List<WmsProductStock> 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); return wmsProductStockMapper.selectWmsProductStockList(wmsProductStock);
} }

@ -2,6 +2,8 @@ package com.hw.wms.service.impl;
import java.util.List; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsRawStockMapper; import com.hw.wms.mapper.WmsRawStockMapper;
@ -43,6 +45,25 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService {
return wmsRawStocks; return wmsRawStocks;
} }
/**
* join warehousematerialsaleorder
*
* @param wmsRawStock
* @return
*/
@Override
public List<WmsRawStock> 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<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockJoinList(wmsRawStock);
;
return wmsRawStocks;
}
/** /**
* *
* *
@ -102,6 +123,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService {
/** /**
* ID * ID
*
* @param wmsRawStock * @param wmsRawStock
* @return * @return
*/ */

@ -49,6 +49,19 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService
return wmsStockTotalMapper.selectWmsStockTotalList(wmsStockTotal); return wmsStockTotalMapper.selectWmsStockTotalList(wmsStockTotal);
} }
/**
* ,Join warehouse,material,sale_order
*
* @param wmsStockTotal
* @return
*/
@Override
public List<WmsStockTotal> selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal)
{
return wmsStockTotalMapper.selectWmsStockTotalJoinList(wmsStockTotal);
}
/** /**
* *
* *

@ -84,6 +84,7 @@
<where> <where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if> <if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="warehouseInstockType != null and warehouseInstockType != ''"> and warehouse_instock_type = #{warehouseInstockType}</if> <if test="warehouseInstockType != null and warehouseInstockType != ''"> and warehouse_instock_type = #{warehouseInstockType}</if>
<if test="warehouseInstockTypeStr != null and warehouseInstockTypeStr != ''"> and warehouse_instock_type in ('2','3')</if>
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if> <if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if> <if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if> <if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>

@ -29,6 +29,7 @@
<result property="instockDate" column="instock_date"/> <result property="instockDate" column="instock_date"/>
<result property="materialCode" column="material_code"/> <result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/> <result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="orderAmount" column="order_amount"/> <result property="orderAmount" column="order_amount"/>
<result property="warehouseName" column="warehouse_name"/> <result property="warehouseName" column="warehouse_name"/>
<result property="applyAmount" column="apply_amount"/> <result property="applyAmount" column="apply_amount"/>
@ -47,6 +48,7 @@
wps.product_id, wps.product_id,
mbmi.material_code, mbmi.material_code,
mbmi.material_name, mbmi.material_name,
mbmi.material_spec,
wps.plan_code, wps.plan_code,
wps.plan_detail_code, wps.plan_detail_code,
wps.sale_order_id, wps.sale_order_id,
@ -71,15 +73,19 @@
<if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if> <if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if> <if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if>
<if test="stockTypeStr != null and stockTypeStr != ''">and wps.stock_type in ('2','3')</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if> <if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if> <if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if> <if test="productId != null ">and wps.product_id = #{productId}</if>
<if test="planCode != null ">and wps.plan_code = #{planCode}</if> <if test="planCode != null ">and wps.plan_code = #{planCode}</if>
<if test="planDetailCode != null ">and wps.plan_detail_code = #{planDetailCode}</if> <if test="planDetailCode != null ">and wps.plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null ">and wps.saleorder_code = #{saleorderCode}</if> <if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="totalAmount != null ">and wps.total_amount = #{totalAmount}</if> <if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="frozenAmount != null ">and wps.frozen_amount = #{frozenAmount}</if> <if test="materialSpec != null and materialSpec != ''">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
<if test="occupyAmount != null ">and wps.occupy_amount = #{occupyAmount}</if> '%')</if>
<if test="saleOrderId != null ">and wps.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wps.sale_order_id !=0</if>
<if test="saleorderCode != null and saleorderCode != ''">and wps.saleorder_code like concat('%', #{saleorderCode}, '%')</if>
<if test="updateDate != null ">and wps.update_date = #{updateDate}</if> <if test="updateDate != null ">and wps.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if> <if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and wps.instock_date = #{instockDate}</if> <if test="instockDate != null ">and wps.instock_date = #{instockDate}</if>

@ -30,7 +30,9 @@
<result property="activeFlag" column="active_flag"/> <result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/> <result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/> <result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="warehouseName" column="warehouse_name"/> <result property="warehouseName" column="warehouse_name"/>
<result property="saleorderCode" column="saleorder_code"/>
</resultMap> </resultMap>
<sql id="selectWmsRawStockVo"> <sql id="selectWmsRawStockVo">
@ -43,6 +45,7 @@
wrs.material_id, wrs.material_id,
mbmi.material_code, mbmi.material_code,
mbmi.material_name, mbmi.material_name,
mbmi.material_spec,
wrs.instock_batch, wrs.instock_batch,
wrs.pallet_info_code, wrs.pallet_info_code,
wrs.sale_order_id, wrs.sale_order_id,
@ -282,4 +285,68 @@
</select> </select>
<select id="selectWmsRawStockJoinList" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
select wrs.raw_stock_id,
wrs.warehouse_id,
wbw.warehouse_name,
wbw.warehouse_floor,
wrs.location_code,
wrs.stock_type,
wrs.material_id,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
wrs.instock_batch,
wrs.pallet_info_code,
wrs.sale_order_id,
wrs.safe_flag,
wrs.instock_date,
wrs.last_outstock_time,
wrs.quality_status,
wrs.complete_flag,
wrs.total_amount,
wrs.frozen_amount,
wrs.occupy_amount,
wrs.supplier_id,
wrs.create_by,
wrs.create_date,
wrs.update_by,
wrs.update_date,
wrs.active_flag,
mso.saleorder_code
from wms_raw_stock wrs
left join wms_base_warehouse wbw on wbw.warehouse_id = wrs.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wrs.material_id
left join mes_sale_order mso on wrs.sale_order_id = mso.sale_order_id
<where>
<if test="warehouseId != null ">and wrs.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wrs.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wrs.stock_type = #{stockType}</if>
<if test="materialId != null ">and wrs.material_id = #{materialId}</if>
<if test="saleOrderId != null ">and wrs.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wrs.safe_flag = #{safeFlag}</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialSpec != null and materialSpec != ''">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode}, '%')</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wrs.quality_status = #{qualityStatus}</if>
<if test="totalAmount != null ">and wrs.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wrs.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wrs.occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null ">and wrs.supplier_id = #{supplierId}</if>
<if test="updateDate != null ">and wrs.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wrs.active_flag = #{activeFlag}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''">
and wrs.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
order by wrs.instock_date desc
</select>
</mapper> </mapper>

@ -25,6 +25,7 @@
<result property="materialSpec" column="material_spec"/> <result property="materialSpec" column="material_spec"/>
<result property="warehouseName" column="warehouse_name"/> <result property="warehouseName" column="warehouse_name"/>
<result property="outstockAmount" column="outstock_amount"/> <result property="outstockAmount" column="outstock_amount"/>
<result property="saleorderCode" column="saleorder_code"/>
</resultMap> </resultMap>
<sql id="selectWmsStockTotalVo"> <sql id="selectWmsStockTotalVo">
@ -59,9 +60,6 @@
<if test="materialId != null ">and wst.material_id = #{materialId}</if> <if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="saleOrderId != null ">and wst.sale_order_id = #{saleOrderId}</if> <if test="saleOrderId != null ">and wst.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wst.safe_flag = #{safeFlag}</if> <if test="safeFlag != null and safeFlag != ''">and wst.safe_flag = #{safeFlag}</if>
<if test="totalAmount != null ">and wst.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wst.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wst.occupy_amount = #{occupyAmount}</if>
<if test="createDate != null ">and wst.create_date = #{createDate}</if> <if test="createDate != null ">and wst.create_date = #{createDate}</if>
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if> <if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if> <if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
@ -194,4 +192,48 @@
</select> </select>
<select id="selectWmsStockTotalJoinList" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id,
wst.warehouse_id,
wbw.warehouse_name,
wst.warehouse_floor,
wst.stock_type,
wst.material_id,
wst.sale_order_id,
wst.safe_flag,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
wst.total_amount,
wst.frozen_amount,
wst.occupy_amount,
wst.create_by,
wst.create_date,
wst.update_by,
wst.update_date,
wst.active_flag,
mso.saleorder_code
from wms_stock_total wst
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id
left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id
<where>
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="stockTypeStr != null and stockTypeStr != ''">and wst.stock_type in ('2','3')</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialSpec != null and materialSpec != ''">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="saleOrderId != null ">and wst.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wst.sale_order_id !=0</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode}, '%')</if>
<if test="createDate != null ">and wst.create_date = #{createDate}</if>
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
</where>
</select>
</mapper> </mapper>

@ -46,7 +46,7 @@ export function delWmslocation(locationId) {
// 查询仓库列表 // 查询仓库列表
export function getWarehouses(query) { export function getWarehouses(query) {
return request({ return request({
url: '/wms/wmslocation/getWarehouses', url: '/wms/stocktotal/getWarehouses',
method: 'get', method: 'get',
params: query params: query
}) })

@ -32,15 +32,54 @@
<el-col :span="20" :xs="24"> <el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px"> label-width="68px">
<!-- <el-form-item label="仓库ID" prop="warehouseId">--> <el-form-item label="物料编码" prop="materialCode">
<!-- <el-input--> <el-input
<!-- v-model="queryParams.warehouseId"--> v-model="queryParams.materialCode"
<!-- placeholder="请输入仓库ID"--> placeholder="请输入物料编码"
<!-- clearable--> clearable
<!-- @keyup.enter.native="handleQuery"--> @keyup.enter.native="handleQuery"
<!-- />--> />
<!-- </el-form-item>--> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
placeholder="请输入销售订单"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="安全库存" prop="safeFlag">
<el-select
v-model="queryParams.safeFlag"
placeholder="请选择安全库存标识"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.mes_safe_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!--el-form-item label="创建时间">
<el-date-picker <el-date-picker
v-model="daterangeCreateDate" v-model="daterangeCreateDate"
style="width: 340px" style="width: 340px"
@ -50,7 +89,7 @@
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
></el-date-picker> ></el-date-picker>
</el-form-item> </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>
@ -58,66 +97,22 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['wms:stocktotal:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['wms:stocktotal:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['wms:stocktotal:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wms:stocktotal:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="stocktotalList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="stocktotalList" @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="总库存ID" align="center" prop="stockTotalId"/>--> <!-- <el-table-column label="总库存ID" align="center" prop="stockTotalId"/>-->
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>--> <!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>-->
<el-table-column label="仓库名称" align="center" prop="warehouseName"/> <el-table-column label="仓库名称" align="center" prop="warehouseName"/>
<el-table-column label="仓库楼层" align="center" prop="warehouseFloor"/> <el-table-column label="仓库楼层" align="center" prop="warehouseFloor"/>
<!-- <el-table-column label="库存类型" align="center" prop="stockType"/>--> <!-- <el-table-column label="库存类型" align="center" prop="stockType"/>-->
<el-table-column label="物料ID" align="center" prop="materialId"/> <el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料编号" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/> <el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="安全库存" align="center" prop="safeFlag" width="80">
<template slot-scope="scope">
{{scope.row.saleOrderId === 0 ? "是" :"否"}}
</template>
</el-table-column>
<el-table-column label="销售订单" align="center" prop="saleorderCode"/>
<el-table-column label="总数量" align="center" prop="totalAmount"/> <el-table-column label="总数量" align="center" prop="totalAmount"/>
<!--el-table-column label="冻结数量" align="center" prop="frozenAmount"/--> <!--el-table-column label="冻结数量" align="center" prop="frozenAmount"/-->
<el-table-column label="占用数量" align="center" prop="occupyAmount"/> <el-table-column label="占用数量" align="center" prop="occupyAmount"/>
@ -147,49 +142,40 @@
<el-divider content-position="center">库位库存明细信息</el-divider> <el-divider content-position="center">库位库存明细信息</el-divider>
<el-table v-loading="loadingTwo" :data="rawstockList" @selection-change="handleSelectionChange"> <el-table v-loading="loadingTwo" :data="rawstockList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="原材料库存ID" align="center" prop="rawStockId" />--> <!-- <el-table-column label="原材料库存ID" align="center" prop="rawStockId" />-->
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>--> <!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>-->
<el-table-column label="仓库名称" align="center" prop="warehouseName" width="120" v-if="columns[0].visible"/> <el-table-column label="仓库名称" align="center" prop="warehouseName" width="120" v-if="columns[0].visible"/>
<el-table-column label="仓库楼层" align="center" prop="warehouseFloor" v-if="columns[1].visible"/>
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[2].visible"/> <el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[2].visible"/>
<!-- <el-table-column label="库存类型" align="center" prop="stockType"/>--> <!-- <el-table-column label="库存类型" align="center" prop="stockType"/>-->
<el-table-column label="物料编号" align="center" prop="materialCode" width="120" v-if="columns[3].visible"/> <el-table-column label="物料编码" align="center" prop="materialCode" width="120" v-if="columns[3].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150" v-if="columns[4].visible"/> <el-table-column label="物料名称" align="center" prop="materialName" width="120" v-if="columns[4].visible"/>
<el-table-column label="成品编号" align="center" prop="materialCode" width="120" v-if="columns[10].visible"/> <el-table-column label="物料规格" align="center" prop="materialSpec" width="150" v-if="columns[16].visible"/>
<el-table-column label="成品名称" align="center" prop="materialName" width="150" v-if="columns[11].visible"/>
<el-table-column label="计划编号" align="center" prop="planCode" width="100" v-if="columns[12].visible"/> <el-table-column label="派工单号" align="center" prop="planCode" width="100" v-if="columns[12].visible"/>
<el-table-column label="计划明细编号" align="center" prop="planDetailCode" width="120" v-if="columns[13].visible"/> <el-table-column label="生产明细编号" align="center" prop="planDetailCode" width="120"
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" width="120" v-if="columns[14].visible"/> v-if="columns[13].visible"/>
<el-table-column label="入库批次号" align="center" prop="instockBatch" width="100" v-if="columns[5].visible"/> <el-table-column label="销售订单" align="center" prop="saleorderCode" width="120"
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" width="120" v-if="columns[6].visible"/> v-if="columns[14].visible"/>
<!-- <el-table-column label="入库时间" align="center" prop="instockDate" width="180">--> <el-table-column label="安全库存" align="center" prop="safeFlag" width="80"
<!-- <template slot-scope="scope">--> v-if="columns[15].visible">
<!-- <span>{{ parseTime(scope.row.instockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>--> <template slot-scope="scope">
<!-- </template>--> {{scope.row.saleOrderId === 0 ? "是" :"否"}}
<!-- </el-table-column>--> </template>
<!-- <el-table-column label="最晚出库时间" align="center" prop="lastOutstockTime" width="180">--> </el-table-column>
<!-- <template slot-scope="scope">--> <el-table-column label="物料条码" align="center" prop="instockBatch" width="100" v-if="columns[5].visible"/>
<!-- <span>{{ parseTime(scope.row.lastOutstockTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>--> <el-table-column label="容器码" align="center" prop="palletInfoCode" width="120"
<!-- </template>--> v-if="columns[6].visible"/>
<!-- </el-table-column>--> <el-table-column label="入库时间" align="center" prop="instockDate" width="180">
<!-- <el-table-column label="质检状态" align="center" prop="qualityStatus" />--> <template slot-scope="scope">
<!-- <el-table-column label="完整标识" align="center" prop="completeFlag" />--> <span>{{ parseTime(scope.row.instockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="总数量" align="center" prop="totalAmount" v-if="columns[7].visible"/> <el-table-column label="总数量" align="center" prop="totalAmount" v-if="columns[7].visible"/>
<!-- <el-table-column label="冻结数量" align="center" prop="frozenAmount"/>--> <el-table-column label="完整标识" align="center" prop="completeFlag" v-if="columns[17].visible">
<el-table-column label="占用数量" align="center" prop="occupyAmount" v-if="columns[8].visible"/>
<!-- <el-table-column label="供应商ID" align="center" prop="supplierId" />-->
<el-table-column label="创建时间" align="center" prop="createDate" width="180" v-if="columns[9].visible">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <dict-tag :options="dict.type.wms_stock_complete_flag" :value="scope.row.safeFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="最后更新时间" align="center" prop="updateDate" width="180" >-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="有效标记" align="center" prop="activeFlag" />-->
</el-table> </el-table>
<pagination <pagination
v-show="twoPTotal>0" v-show="twoPTotal>0"
@ -201,52 +187,6 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 添加或修改原材料库存对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID"/>
</el-form-item>
<el-form-item label="仓库楼层" prop="warehouseFloor">
<el-input v-model="form.warehouseFloor" placeholder="请输入仓库楼层"/>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID"/>
</el-form-item>
<el-form-item label="总数量;仓库存放的总数量" prop="totalAmount">
<el-input v-model="form.totalAmount" placeholder="请输入总数量;仓库存放的总数量"/>
</el-form-item>
<el-form-item label="冻结数量;手动冻结的,暂时可不用" prop="frozenAmount">
<el-input v-model="form.frozenAmount" placeholder="请输入冻结数量;手动冻结的,暂时可不用"/>
</el-form-item>
<el-form-item label="占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;" prop="occupyAmount">
<el-input v-model="form.occupyAmount" placeholder="请输入占用数量;申请时占用的数量,在出库时要减去出库数量,并且总数量要同步更新;"/>
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-date-picker clearable
v-model="form.createDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="form.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效标记" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入有效标记"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -264,6 +204,7 @@ import {getWarehouses} from "@//api/wms/wmslocation";
export default { export default {
name: "Stocktotal", name: "Stocktotal",
dicts: ['mes_safe_flag', 'wms_stock_complete_flag'],
data() { data() {
return { return {
// //
@ -302,11 +243,15 @@ export default {
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 2, pageSize: 10,
warehouseId: null, warehouseId: null,
warehouseFloor: null, warehouseFloor: null,
stockType: null,
materialId: null, materialId: null,
materialCode: null,
materialName: null,
materialSpec: null,
saleorderCode: null,
safeFlag: null,
totalAmount: null, totalAmount: null,
frozenAmount: null, frozenAmount: null,
occupyAmount: null, occupyAmount: null,
@ -316,7 +261,7 @@ export default {
}, },
queryTwoParams: { queryTwoParams: {
pageNum: 1, pageNum: 1,
pageSize: 2 pageSize: 10
}, },
// //
form: {}, form: {},
@ -324,48 +269,68 @@ export default {
rawstockList: [], rawstockList: [],
// //
columns: [], columns: [],
STOCK_TYPE: {
RAW: "1",
SEMI: "2",
PRODUCT: "3",
}
}; };
}, },
watch: {
//
warehouseName(val) {
this.$refs.tree.filter(val);
}
},
created() { created() {
this.type = this.$route.query && this.$route.query.type; 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 = this.columns =
[ [
{key: 0, label: `仓库名称`, visible: true}, {key: 0, label: `仓库名称`, visible: true},
{key: 1, label: `仓库楼层`, visible: true}, {key: 1, label: `仓库楼层`, visible: true},
{key: 2, label: `库位编码`, visible: true}, {key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编`, visible: true}, {key: 3, label: `物料编`, visible: true},
{key: 4, label: `物料名称`, visible: true}, {key: 4, label: `物料名称`, visible: true},
{key: 5, label: `入库批次号`, visible: true}, {key: 5, label: `物料条码`, visible: true},
{key: 6, label: `托盘RFID代`, visible: true}, {key: 6, label: `托盘`, visible: true},
{key: 7, label: `总数量`, visible: true}, {key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true}, {key: 8, label: `占用数量`, visible: true},
{key: 9, label: `创建时间`, visible: true}, {key: 9, label: `创建时间`, visible: true},
{key: 10, label: `成品编号`, visible: false}, {key: 10, label: `成品编号`, visible: false},
{key: 11, label: `成品名称`, visible: false}, {key: 11, label: `成品名称`, visible: false},
{key: 12, label: `计划编号`, visible: false}, {key: 12, label: `派工单号`, visible: false},
{key: 13, label: `计划明细编号`, visible: false}, {key: 13, label: `生产明细编号`, visible: false},
{key: 14, 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 = this.columns =
[ [
{key: 0, label: `仓库名称`, visible: true}, {key: 0, label: `仓库名称`, visible: true},
{key: 1, label: `仓库楼层`, visible: true}, {key: 1, label: `仓库楼层`, visible: true},
{key: 2, label: `库位编码`, visible: true}, {key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编`, visible: false}, {key: 3, label: `物料编`, visible: true},
{key: 4, label: `物料名称`, visible: false}, {key: 4, label: `物料名称`, visible: true},
{key: 5, label: `入库批次号`, visible: false}, {key: 5, label: `物料条码`, visible: true},
{key: 6, label: `托盘RFID代`, visible: true}, {key: 6, label: `托盘`, visible: true},
{key: 7, label: `总数量`, visible: true}, {key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true}, {key: 8, label: `占用数量`, visible: true},
{key: 9, label: `创建时间`, visible: true}, {key: 9, label: `创建时间`, visible: true},
{key: 10, label: `成品编号`, visible: true}, {key: 10, label: `成品编号`, visible: false},
{key: 11, label: `成品名称`, visible: true}, {key: 11, label: `成品名称`, visible: false},
{key: 12, label: `计划编号`, visible: true}, {key: 12, label: `派工单号`, visible: true},
{key: 13, label: `计划明细编号`, visible: true}, {key: 13, label: `生产明细编号`, visible: false},
{key: 14, label: `销售订单编号`, visible: true}, {key: 14, label: `销售订单`, visible: true},
{key: 15, label: `安全库存`, visible: true},
{key: 16, label: `物料规格`, visible: true},
{key: 17, label: `完整标识`, visible: false},
] ]
} }
this.getWarehouseList(); this.getWarehouseList();
@ -386,19 +351,20 @@ export default {
/** 查询库位库存明细列表 */ /** 查询库位库存明细列表 */
getTwoList() { getTwoList() {
this.loadingTwo = true; this.loadingTwo = true;
this.queryTwoParams.params = {}; this.queryTwoParams = this.queryParams;
if (null != this.daterangeCreateDate && '' != this.daterangeCreateDate) { // if (null != this.daterangeCreateDate && '' != this.daterangeCreateDate) {
this.queryTwoParams.params["beginCreateDate"] = this.daterangeCreateDate[0]; // this.queryTwoParams.params["beginCreateDate"] = this.daterangeCreateDate[0];
this.queryTwoParams.params["endCreateDate"] = this.daterangeCreateDate[1]; // this.queryTwoParams.params["endCreateDate"] = this.daterangeCreateDate[1];
} // }
if (this.type === '1') {
if (this.type === this.STOCK_TYPE.RAW) {
listRawstock(this.queryTwoParams).then(response => { listRawstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows; this.rawstockList = response.rows;
this.twoPTotal = response.total; this.twoPTotal = response.total;
this.loadingTwo = false; this.loadingTwo = false;
}); });
} }
if (this.type === '3') { if (this.type === this.STOCK_TYPE.PRODUCT) {
listProductstock(this.queryTwoParams).then(response => { listProductstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows; this.rawstockList = response.rows;
this.twoPTotal = response.total; this.twoPTotal = response.total;
@ -439,7 +405,10 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.warehouseId = null;
this.queryTwoParams.warehouseId = null;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.$refs.tree.setCurrentKey(null);
this.handleQuery(); this.handleQuery();
}, },
// //
@ -448,12 +417,6 @@ export default {
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加原材料库存";
},
// //
filterNode(value, data) { filterNode(value, data) {
@ -471,7 +434,14 @@ export default {
getWarehouseList() { getWarehouseList() {
this.loading = true; this.loading = true;
this.loadingTwo = 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.warehouseList = response.data;
// this.queryParams.warehouseId = this.warehouseList[0].warehouseId; // this.queryParams.warehouseId = this.warehouseList[0].warehouseId;
// this.queryTwoParams.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) { handleDelete(row) {

Loading…
Cancel
Save