完善库存管理
This commit is contained in:
parent
61baca4e0c
commit
a516971ece
|
|
@ -73,6 +73,11 @@
|
|||
<artifactId>order</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.qihangerp.module</groupId>
|
||||
<artifactId>stock</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package cn.qihangerp.oms.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.common.AjaxResult;
|
||||
import cn.qihangerp.common.PageQuery;
|
||||
import cn.qihangerp.common.ResultVo;
|
||||
import cn.qihangerp.common.TableDataInfo;
|
||||
|
||||
import cn.qihangerp.module.stock.domain.WmsStockIn;
|
||||
import cn.qihangerp.module.stock.request.StockInCreateRequest;
|
||||
import cn.qihangerp.module.stock.request.StockInRequest;
|
||||
import cn.qihangerp.module.stock.service.WmsStockInService;
|
||||
import cn.qihangerp.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/stockIn")
|
||||
public class StockInController extends BaseController {
|
||||
private final WmsStockInService stockInService;
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsStockIn bo, PageQuery pageQuery)
|
||||
{
|
||||
var pageList = stockInService.queryPageList(bo,pageQuery);
|
||||
return getDataTable(pageList);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public AjaxResult createEntry(@RequestBody StockInCreateRequest request)
|
||||
{
|
||||
ResultVo<Long> resultVo = stockInService.createEntry(getUserId(), getUsername(), request);
|
||||
if(resultVo.getCode()==0)
|
||||
return AjaxResult.success();
|
||||
else return AjaxResult.error(resultVo.getMsg());
|
||||
}
|
||||
|
||||
@PostMapping("/in")
|
||||
public AjaxResult in(@RequestBody StockInRequest request)
|
||||
{
|
||||
ResultVo<Long> resultVo = stockInService.stockIn(getUserId(), getUsername(), request);
|
||||
if(resultVo.getCode()==0)
|
||||
return AjaxResult.success();
|
||||
else return AjaxResult.error(resultVo.getMsg());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
WmsStockIn entry = stockInService.getDetailAndItemById(id);
|
||||
|
||||
return success(entry);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.qihangerp.oms.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.common.PageQuery;
|
||||
import cn.qihangerp.common.PageResult;
|
||||
import cn.qihangerp.common.TableDataInfo;
|
||||
|
||||
import cn.qihangerp.module.goods.domain.OGoodsSku;
|
||||
import cn.qihangerp.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/stockOut")
|
||||
public class StockOutController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OGoodsSku bo, PageQuery pageQuery)
|
||||
{
|
||||
// var pageList = goodsService.querySkuPageList(bo,pageQuery);
|
||||
return getDataTable(new PageResult<>());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package cn.qihangerp.oms.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.common.AjaxResult;
|
||||
import cn.qihangerp.common.TableDataInfo;
|
||||
import cn.qihangerp.module.stock.domain.WmsWarehouse;
|
||||
import cn.qihangerp.module.stock.domain.WmsWarehousePosition;
|
||||
import cn.qihangerp.module.stock.service.WmsWarehousePositionService;
|
||||
import cn.qihangerp.module.stock.service.WmsWarehouseService;
|
||||
import cn.qihangerp.security.common.BaseController;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/warehouse")
|
||||
public class WarehouseController extends BaseController {
|
||||
private final WmsWarehouseService warehouseService;
|
||||
private final WmsWarehousePositionService positionService;
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsWarehouse bo)
|
||||
{
|
||||
LambdaQueryWrapper<WmsWarehouse> qw = new LambdaQueryWrapper<WmsWarehouse>()
|
||||
.eq(bo.getStatus()!=null,WmsWarehouse::getStatus, bo.getStatus())
|
||||
.like(StringUtils.hasText(bo.getNumber()),WmsWarehouse::getNumber,bo.getNumber())
|
||||
.like(StringUtils.hasText(bo.getName()),WmsWarehouse::getName,bo.getName())
|
||||
;
|
||||
List<WmsWarehouse> wmsWarehouses = warehouseService.list(qw);
|
||||
return getDataTable(wmsWarehouses);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(warehouseService.getById(id));
|
||||
}
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmsWarehouse warehouse)
|
||||
{
|
||||
warehouse.setCreateBy(getUsername());
|
||||
warehouse.setCreateTime(new Date());
|
||||
boolean save = warehouseService.save(warehouse);
|
||||
if(save){
|
||||
WmsWarehousePosition position = new WmsWarehousePosition();
|
||||
position.setWarehouseId(warehouse.getId());
|
||||
position.setParentId(0);
|
||||
position.setParentId1(0);
|
||||
position.setParentId2(0);
|
||||
position.setNumber(warehouse.getNumber());
|
||||
position.setName(warehouse.getName());
|
||||
position.setIsDelete(0);
|
||||
position.setAddress(warehouse.getAddress());
|
||||
position.setRemark(warehouse.getRemark());
|
||||
position.setCreateBy(getUsername());
|
||||
position.setCreateTime(new Date());
|
||||
positionService.save(position);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmsWarehouse warehouse)
|
||||
{
|
||||
warehouse.setUpdateBy(getUsername());
|
||||
warehouse.setUpdateTime(new Date());
|
||||
return toAjax(warehouseService.updateById(warehouse));
|
||||
}
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(warehouseService.removeBatchByIds(Arrays.stream(ids).toList()));
|
||||
}
|
||||
|
||||
@GetMapping("/position/list")
|
||||
public TableDataInfo positionList(Long warehouseId)
|
||||
{
|
||||
LambdaQueryWrapper<WmsWarehousePosition> qw = new LambdaQueryWrapper<WmsWarehousePosition>()
|
||||
.eq(WmsWarehousePosition::getWarehouseId,warehouseId)
|
||||
;
|
||||
List<WmsWarehousePosition> list = positionService.list(qw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@GetMapping("/position/search")
|
||||
public TableDataInfo searchPosition(Long warehouseId,String number)
|
||||
{
|
||||
LambdaQueryWrapper<WmsWarehousePosition> qw = new LambdaQueryWrapper<WmsWarehousePosition>()
|
||||
.eq(WmsWarehousePosition::getWarehouseId,warehouseId)
|
||||
.like(WmsWarehousePosition::getNumber,number)
|
||||
;
|
||||
List<WmsWarehousePosition> list = positionService.list(qw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/position")
|
||||
public AjaxResult positionAdd(@RequestBody WmsWarehousePosition position) {
|
||||
position.setCreateBy(getUsername());
|
||||
position.setCreateTime(new Date());
|
||||
position.setParentId1(0);
|
||||
position.setParentId2(0);
|
||||
positionService.save(position);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@GetMapping(value = "/position/{id}")
|
||||
public AjaxResult getPositionInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(positionService.getById(id));
|
||||
}
|
||||
|
||||
@PutMapping("/position")
|
||||
public AjaxResult positionEdit(@RequestBody WmsWarehousePosition position)
|
||||
{
|
||||
position.setUpdateBy(getUsername());
|
||||
position.setUpdateTime(new Date());
|
||||
return toAjax(positionService.updateById(position));
|
||||
}
|
||||
@DeleteMapping("/position/{ids}")
|
||||
public AjaxResult positionRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(positionService.removeBatchByIds(Arrays.stream(ids).toList()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
<module>oms-api</module>
|
||||
<module>sys-api</module>
|
||||
<module>open-api</module>
|
||||
<module>eureka-server</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
Target Server Version : 80200
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 24/03/2025 13:06:49
|
||||
Date: 24/03/2025 13:49:16
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
|
@ -13980,18 +13980,18 @@ INSERT INTO `sys_menu` VALUES (2100, '私域售后管理', 2, 3, 'offline_afters
|
|||
INSERT INTO `sys_menu` VALUES (2101, '渠道商品管理', 4, 50, 'offline_goods_list', 'offline/goods/index', NULL, 1, 0, 'C', '0', '1', '', 'documentation', 'admin', '2024-07-27 17:33:54', 'admin', '2024-09-07 23:17:59', '');
|
||||
INSERT INTO `sys_menu` VALUES (2103, '手动创建私域订单', 1, 49, 'offline_order_create', 'order/private/create', NULL, 1, 0, 'C', '1', '0', '', 'date', 'admin', '2024-07-27 20:30:07', 'admin', '2025-03-24 11:46:51', '');
|
||||
INSERT INTO `sys_menu` VALUES (2104, '商品库管理', 4, 0, 'goods_list', 'goods/index', NULL, 1, 0, 'C', '0', '0', 'goods', 'example', 'admin', '2024-08-25 14:35:54', 'admin', '2024-09-08 16:14:12', '');
|
||||
INSERT INTO `sys_menu` VALUES (2105, '库存管理', 0, 40, 'wms', NULL, NULL, 1, 0, 'M', '0', '0', '', 'lock', 'admin', '2024-08-25 15:54:14', 'admin', '2024-09-21 19:16:02', '');
|
||||
INSERT INTO `sys_menu` VALUES (2106, '商品入库管理', 2105, 10, 'stock_in', 'wms/stockIn/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'download', 'admin', '2024-08-25 15:56:04', 'admin', '2024-09-22 14:52:26', '');
|
||||
INSERT INTO `sys_menu` VALUES (2105, '库存管理', 0, 40, 'stock', NULL, NULL, 1, 0, 'M', '0', '0', '', 'lock', 'admin', '2024-08-25 15:54:14', 'admin', '2025-03-24 13:32:20', '');
|
||||
INSERT INTO `sys_menu` VALUES (2106, '商品入库管理', 2105, 10, 'stock_in', 'stock/stockIn/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'download', 'admin', '2024-08-25 15:56:04', 'admin', '2025-03-24 13:35:21', '');
|
||||
INSERT INTO `sys_menu` VALUES (2108, '供应商管理', 4, 90, 'supplier_list', 'goods/supplier/index', NULL, 1, 0, 'C', '0', '0', '', 'people', 'admin', '2024-08-25 18:27:55', 'admin', '2024-09-07 15:51:17', '');
|
||||
INSERT INTO `sys_menu` VALUES (2109, '商品分类管理', 4, 80, 'category_list', 'goods/category/index', NULL, 1, 0, 'C', '0', '0', '', 'edit', 'admin', '2024-08-25 18:43:28', 'admin', '2024-09-07 15:47:44', '');
|
||||
INSERT INTO `sys_menu` VALUES (2110, '商品品牌管理', 4, 81, 'brand_list', 'goods/brand/index', NULL, 1, 0, 'C', '0', '0', '', 'icon', 'admin', '2024-08-25 18:45:47', 'admin', '2024-09-07 15:48:31', '');
|
||||
INSERT INTO `sys_menu` VALUES (2111, '分类规格属性', 4, 101, 'goods_category/attribute', 'goods/category/categoryAttribute', NULL, 1, 0, 'C', '1', '0', '', 'button', 'admin', '2024-08-25 18:49:22', 'admin', '2024-09-07 16:17:01', '');
|
||||
INSERT INTO `sys_menu` VALUES (2112, '规格属性值', 4, 102, 'goods_category/attribute_value', 'goods/category/categoryAttributeValue', NULL, 1, 0, 'C', '1', '0', '', 'date', 'admin', '2024-08-25 18:51:55', 'admin', '2024-09-07 16:23:53', '');
|
||||
INSERT INTO `sys_menu` VALUES (2114, '仓库仓位设置', 2105, 90, 'warehouse', 'wms/warehouse/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'cascader', 'admin', '2024-09-21 20:07:26', 'admin', '2024-09-22 11:51:25', '');
|
||||
INSERT INTO `sys_menu` VALUES (2115, '商品库存管理', 2105, 0, 'goods_inventory', 'goods/goodsInventory/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'chart', 'admin', '2024-09-21 20:43:00', 'admin', '2024-10-05 16:30:35', '');
|
||||
INSERT INTO `sys_menu` VALUES (2116, '商品出库管理', 2105, 20, 'stock_out', 'wms/stockOut/index', NULL, 1, 0, 'C', '0', '0', '', 'guide', 'admin', '2024-09-21 20:44:46', 'admin', '2024-09-22 14:52:37', '');
|
||||
INSERT INTO `sys_menu` VALUES (2117, '仓位管理', 2105, 91, 'position', 'wms/warehouse/position', NULL, 1, 0, 'C', '1', '0', '', '404', 'admin', '2024-09-22 11:52:18', 'admin', '2024-09-22 14:48:21', '');
|
||||
INSERT INTO `sys_menu` VALUES (2118, '新建商品入库单', 2105, 11, 'stock_in/create', 'wms/stockIn/create.vue', NULL, 1, 0, 'C', '1', '0', '', '404', 'admin', '2024-09-22 14:49:40', 'admin', '2024-09-22 15:30:10', '');
|
||||
INSERT INTO `sys_menu` VALUES (2114, '仓库仓位设置', 2105, 90, 'warehouse', 'stock/warehouse/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'cascader', 'admin', '2024-09-21 20:07:26', 'admin', '2025-03-24 13:46:52', '');
|
||||
INSERT INTO `sys_menu` VALUES (2115, '商品库存管理', 2105, 0, 'goods_inventory', 'stock/goodsInventory/index.vue', NULL, 1, 0, 'C', '0', '0', '', 'chart', 'admin', '2024-09-21 20:43:00', 'admin', '2025-03-24 13:34:55', '');
|
||||
INSERT INTO `sys_menu` VALUES (2116, '商品出库管理', 2105, 20, 'stock_out', 'stock/stockOut/index', NULL, 1, 0, 'C', '0', '0', '', 'guide', 'admin', '2024-09-21 20:44:46', 'admin', '2025-03-24 13:46:42', '');
|
||||
INSERT INTO `sys_menu` VALUES (2117, '仓位管理', 2105, 91, 'position', 'stock/warehouse/position', NULL, 1, 0, 'C', '1', '0', '', '404', 'admin', '2024-09-22 11:52:18', 'admin', '2025-03-24 13:47:04', '');
|
||||
INSERT INTO `sys_menu` VALUES (2118, '新建商品入库单', 2105, 11, 'stock_in/create', 'stock/stockIn/create.vue', NULL, 1, 0, 'C', '1', '0', '', '404', 'admin', '2024-09-22 14:49:40', 'admin', '2025-03-24 13:35:30', '');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_oss
|
||||
|
|
@ -14453,7 +14453,7 @@ CREATE TABLE `wms_warehouse_position` (
|
|||
`parent_id2` int NOT NULL COMMENT '二级类目id',
|
||||
`address` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
|
||||
`isDelete` int NOT NULL DEFAULT 0 COMMENT '0正常 1删除',
|
||||
`is_delete` int NOT NULL DEFAULT 0 COMMENT '0正常 1删除',
|
||||
`create_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = 启航电商OMS系统
|
||||
VUE_APP_TITLE = 启航电商ERP系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 启航电商OMS系统/开发环境
|
||||
# 启航电商ERP系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = 启航电商OMS系统
|
||||
VUE_APP_TITLE = 启航电商ERP系统
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# 启航电商OMS系统/生产环境
|
||||
# 启航电商ERP系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = 启航电商OMS系统
|
||||
VUE_APP_TITLE = 启航电商ERP系统
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
|
||||
# 启航电商OMS系统/测试环境
|
||||
# 启航电商ERP系统/测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "qihang-oms",
|
||||
"version": "1.6.0",
|
||||
"description": "启航电商OMS系统",
|
||||
"name": "qihang-erp",
|
||||
"version": "2.3.0",
|
||||
"description": "启航电商ERP系统",
|
||||
"author": "qihang",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询仓库货架列表
|
||||
export function listPosition(query) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询仓库货架详细
|
||||
export function getLocation(id) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增仓库货架
|
||||
export function addLocation(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改仓库货架
|
||||
export function updateLocation(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除仓库货架
|
||||
export function delLocation(id) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询入库单列表
|
||||
export function listStockIn(query) {
|
||||
return request({
|
||||
url: '/api/oms-api/stockIn/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询入库单详细
|
||||
export function getWmsStockInEntry(id) {
|
||||
return request({
|
||||
url: '/api/oms-api/stockIn/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增入库单
|
||||
export function stockInCreate(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/stockIn/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function stockIn(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/stockIn/in',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function complete(id) {
|
||||
return request({
|
||||
url: '/wms/WmsStockInEntry/complete/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询出库单列表
|
||||
export function listStockOut(query) {
|
||||
return request({
|
||||
url: '/api/oms-api/stockOut/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询出库单详细
|
||||
export function getStockOutEntry(id) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntry/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getStockOutEntryItem(id) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntry/item/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 出库
|
||||
export function stockOut(data) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntry/stockOut',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询出库明细详情列表
|
||||
export function listStockOutEntryItemDetail(query) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntryItemDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询出库明细详情详细
|
||||
export function getStockOutEntryItemDetail(id) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntryItemDetail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增出库明细详情
|
||||
export function addStockOutEntryItemDetail(data) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntryItemDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改出库明细详情
|
||||
export function updateStockOutEntryItemDetail(data) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntryItemDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除出库明细详情
|
||||
export function delStockOutEntryItemDetail(id) {
|
||||
return request({
|
||||
url: '/wms/stockOutEntryItemDetail/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询仓库货架列表
|
||||
export function listWarehouse(query) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function searchPosition(query) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/position/search',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询仓库货架详细
|
||||
export function getLocation(id) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增仓库货架
|
||||
export function addLocation(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改仓库货架
|
||||
export function updateLocation(data) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除仓库货架
|
||||
export function delLocation(id) {
|
||||
return request({
|
||||
url: '/api/oms-api/warehouse/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">启航电商OMS系统</h3>
|
||||
<h3 class="title">启航电商ERP系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,244 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px">
|
||||
<el-form-item label="入库单号" prop="stockInNum">
|
||||
<el-col :span="24">
|
||||
<el-input v-model="form.stockInNum" style="width:220px" placeholder="请输入入库单号" />
|
||||
<el-button type="" size="mini" @click="genOrderNum">生成单号</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" prop="stockInType">
|
||||
<el-select v-model="form.stockInType" filterable r placeholder="入库类型" >
|
||||
<el-option label="采购入库" value="1"></el-option>
|
||||
<el-option label="销售退货入库" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="源单号" prop="sourceNo">
|
||||
<el-input v-model="form.sourceNo" style="width: 220px;" placeholder="请输入收件人姓名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库商品">
|
||||
<el-row :gutter="10" class="mb8" >
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddSShopOrderItem">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteSShopOrderItem">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<!-- <el-divider content-position="center" style="margin-left: 98px;">商品信息</el-divider> -->
|
||||
|
||||
<el-table style="margin-left: 108px;margin-bottom: 20px;" :data="form.itemList" :row-class-name="rowSShopOrderItemIndex" @selection-change="handleSShopOrderItemSelectionChange" ref="sShopOrderItem">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<!-- <el-table-column label="erp系统商品id" prop="goodsId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsId" placeholder="请输入erp系统商品id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="erp系统商品规格id" prop="specId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.specId" placeholder="请输入erp系统商品规格id" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="商品" prop="skuId" width="350">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-input v-model="scope.row.goodsTitle" placeholder="请输入商品标题" /> -->
|
||||
<el-select v-model="scope.row.skuId" filterable remote reserve-keyword placeholder="搜索商品SKU" style="width: 330px;"
|
||||
:remote-method="searchSku" :loading="skuListLoading" @change="skuChanage(scope.row)">
|
||||
<el-option v-for="item in skuList" :key="item.id"
|
||||
:label="item.goodsName + ' ' + item.skuName +' - ' + item.skuCode"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图片" prop="goodsImg" width="150">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-input v-model="scope.row.goodsImg" placeholder="请输入商品图片" /> -->
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.goodsImg"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品规格" prop="skuName" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuName" disabled placeholder="请输入商品规格" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Sku编码" prop="skuCode" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuCode" disabled placeholder="请输入商品规格编码" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="quantity" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.number="scope.row.quantity" placeholder="请输入商品数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-form-item label="操作人" prop="stockInOperator">
|
||||
<el-input v-model="form.stockInOperator" style="width: 220px;" placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 400px;" placeholder="备注" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="margin-left: 108px;">
|
||||
<el-button type="primary" @click="submitForm">创建入库单</el-button>
|
||||
<!-- <el-button @click="cancel">取 消</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchSku } from "@/api/goods/goods";
|
||||
import {stockInCreate} from "@/api/wms/stockIn";
|
||||
|
||||
export default {
|
||||
name: "StockInCreate",
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {
|
||||
stockInNum:null,
|
||||
stockInType:null,
|
||||
sourceNo:null,
|
||||
itemList:[]
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockInNum: [{ required: true, message: '单号不能为空' }],
|
||||
stockInType: [{ required: true, message: '请选择入库类型' }],
|
||||
sourceNo: [{ required: true, message: '源单号不能为空' }],
|
||||
stockInOperator: [{ required: true, message: '请填写操作人' }],
|
||||
},
|
||||
skuListLoading: false,
|
||||
skuList: [],
|
||||
|
||||
// 子表选中数据
|
||||
checkedSShopOrderItem: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
genOrderNum(){
|
||||
const timestamp = Date.now();
|
||||
// 可以使用随机数增加订单号的唯一性
|
||||
const randomNumber = Math.floor(Math.random() * 1000);
|
||||
const orderNum = `${timestamp}${randomNumber}`;
|
||||
this.form.stockInNum = orderNum;
|
||||
console.log("======生成单号=======",orderNum)
|
||||
},
|
||||
// getDate() {
|
||||
// var now = new Date();
|
||||
// var year = now.getFullYear(); //得到年份
|
||||
// var month = now.getMonth(); //得到月份
|
||||
// var date = now.getDate(); //得到日期
|
||||
// var hour = " 00:00:00"; //默认时分秒 如果传给后台的格式为年月日时分秒,就需要加这个,如若不需要,此行可忽略
|
||||
// month = month + 1;
|
||||
// month = month.toString().padStart(2, "0");
|
||||
// date = date.toString().padStart(2, "0");
|
||||
// var defaultDate = `${year}-${month}-${date}`;//
|
||||
// return defaultDate;
|
||||
// },
|
||||
// 搜索SKU
|
||||
searchSku(query) {
|
||||
this.shopLoading = true;
|
||||
const qw = {
|
||||
keyword: query
|
||||
}
|
||||
searchSku(qw).then(res => {
|
||||
this.skuList = res.rows;
|
||||
this.skuListLoading = false;
|
||||
})
|
||||
},
|
||||
skuChanage(row) {
|
||||
console.log('=====0000====',row)
|
||||
const spec = this.skuList.find(x => x.id === row.skuId);
|
||||
if (spec) {
|
||||
console.log('=======11111==', spec)
|
||||
row.skuId = spec.id
|
||||
row.goodsId = spec.goodsId
|
||||
// row.sku = spec.colorValue + ' ' + spec.sizeValue + ' ' + spec.styleValue
|
||||
row.skuName = spec.skuName
|
||||
row.goodsImg = spec.colorImage
|
||||
row.skuCode = spec.skuCode
|
||||
row.goodsName = spec.goodsName
|
||||
row.quantity = 1
|
||||
|
||||
}
|
||||
},
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
handleAddSShopOrderItem() {
|
||||
let obj = {};
|
||||
obj.skuId = "";
|
||||
obj.goodsId = "";
|
||||
obj.skuCode = "";
|
||||
obj.goodsName = "";
|
||||
obj.goodsImg = "";
|
||||
obj.skuName = "";
|
||||
obj.quantity = "";
|
||||
this.form.itemList.push(obj);
|
||||
},
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
handleDeleteSShopOrderItem() {
|
||||
if (this.checkedSShopOrderItem.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的商品数据");
|
||||
} else {
|
||||
const sShopOrderItemList = this.form.itemList;
|
||||
const checkedSShopOrderItem = this.checkedSShopOrderItem;
|
||||
this.form.itemList = sShopOrderItemList.filter(function(item) {
|
||||
return checkedSShopOrderItem.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleSShopOrderItemSelectionChange(selection) {
|
||||
this.checkedSShopOrderItem = selection.map(item => item.index)
|
||||
},
|
||||
/** ${subTable.functionName}序号 */
|
||||
rowSShopOrderItemIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if(this.form.itemList && this.form.itemList.length >0){
|
||||
for(var i=0;i<this.form.itemList.length;i++){
|
||||
if(!this.form.itemList[i].skuId || !this.form.itemList[i].quantity){
|
||||
this.$modal.msgError("请完善商品信息");
|
||||
return
|
||||
}
|
||||
}
|
||||
// this.form.itemList.forEach(x=>{
|
||||
// if(!x.goodsId || !x.quantity){
|
||||
// this.$modal.msgError("请完善商品信息");
|
||||
// return
|
||||
// }
|
||||
// })
|
||||
|
||||
console.log('======创建入库单=====',this.form)
|
||||
stockInCreate(this.form).then(response => {
|
||||
this.$modal.msgSuccess("订单创建成功");
|
||||
// 调用全局挂载的方法,关闭当前标签页
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
this.$router.push('/wms/stock_in');
|
||||
});
|
||||
|
||||
}else{
|
||||
this.$modal.msgError("请添加商品");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,434 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="入库单号" prop="stockInNum">
|
||||
<el-input
|
||||
v-model="queryParams.stockInNum"
|
||||
placeholder="请输入入库单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号" prop="sourceNo">
|
||||
<el-input
|
||||
v-model="queryParams.sourceNo"
|
||||
placeholder="请输入来源单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库类型" prop="stockInType">
|
||||
<el-select v-model="form.stockInType" filterable r placeholder="入库类型" >
|
||||
<el-option label="采购入库" value="1"></el-option>
|
||||
<el-option label="退货入库" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="stockInTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.stockInTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择入库时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新建商品入库单</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:WmsStockInEntry:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="WmsStockInEntryList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="主键ID" align="center" prop="id" />
|
||||
<el-table-column label="单号" align="center" prop="stockInNum" />
|
||||
<el-table-column label="来源单号" align="center" prop="sourceNo" />
|
||||
<!-- <el-table-column label="来源单id" align="center" prop="sourceId" />-->
|
||||
<el-table-column label="入库类型" align="center" prop="stockInType" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.stockInType ===1 ">采购入库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.stockInType ===2 ">退货入库</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品数" align="center" prop="sourceGoodsUnit" />
|
||||
<el-table-column label="商品规格数" align="center" prop="sourceSpecUnit" />
|
||||
<el-table-column label="总件数" align="center" prop="sourceSpecUnitTotal" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="操作入库人id" align="center" prop="stockInOperatorId" />-->
|
||||
<el-table-column label="操作入库人" align="center" prop="stockInOperator" />
|
||||
<el-table-column label="最后入库时间" align="center" prop="stockInTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.stockInTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 0">待入库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 1">部分入库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">完全入库</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status === 0 || scope.row.status === 1"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleStockIn(scope.row)"
|
||||
v-hasPermi="['wms:WmsStockInEntry:edit']"
|
||||
>入库</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status ===1 "
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleStockInComplete(scope.row)"
|
||||
v-hasPermi="['api:goodsInventory:remove']"
|
||||
>入库完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改入库单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
|
||||
<!-- <el-descriptions title="表单信息">-->
|
||||
<!-- <el-descriptions-item label="ID">{{form.id}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="入库单号">{{form.stockInNum}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="来源单号">{{form.sourceNo}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="类型">-->
|
||||
<!-- <el-tag size="small" v-if="form.stockInType ===1 ">采购入库</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="form.stockInType ===2 ">退货入库</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
<!-- <el-descriptions-item label="备注">-->
|
||||
<!-- {{form.remark}}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="状态">-->
|
||||
<!-- <el-tag size="small" v-if="form.status ===0 ">待入库</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="form.status ===1 ">部分入库</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="form.status ===2 ">完全入库</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
<!-- <el-descriptions-item label="创建时间">-->
|
||||
<!-- {{ parseTime(form.createTime) }}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="上次入库时间">-->
|
||||
<!-- {{ parseTime(form.stockInTime) }}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- <el-descriptions title="商品统计">-->
|
||||
<!-- <el-descriptions-item label="商品数"> {{ form.sourceGoodsUnit }}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="商品规格数"> {{ form.sourceSpecUnit }}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="总件数"> {{ form.sourceSpecUnitTotal }}</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- <el-descriptions title="入库操作"></el-descriptions>-->
|
||||
<el-form-item label="入库仓库" prop="warehouseId">
|
||||
<el-select v-model="form.warehouseId" filterable r placeholder="入库类型" >
|
||||
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库人" prop="stockInOperator">
|
||||
<el-input v-model="form.stockInOperator" placeholder="请输入操作入库人" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="入库时间" prop="stockInTime">-->
|
||||
<!-- <el-date-picker clearable-->
|
||||
<!-- v-model="form.stockInTime"-->
|
||||
<!-- type="datetime"-->
|
||||
<!-- value-format="yyyy-MM-dd HH:mm:ss"-->
|
||||
<!-- placeholder="请选择入库时间">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-divider content-position="center">入库明细</el-divider>
|
||||
|
||||
<el-table style="margin-bottom: 10px;" :data="itemList" :row-class-name="rowWmsStockInEntryItemIndex" ref="wmsStockInEntryItem">
|
||||
<!-- <el-table-column type="selection" width="50" align="center" />-->
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="商品图片" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.goodsImage"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品标题" prop="goodsName" ></el-table-column>
|
||||
<el-table-column label="规格" width="150" prop="skuName">
|
||||
</el-table-column>
|
||||
<el-table-column label="sku编码" prop="skuCode"></el-table-column>
|
||||
<el-table-column label="数量" prop="quantity"></el-table-column>
|
||||
<el-table-column label="已入库" prop="inQuantity"></el-table-column>
|
||||
<el-table-column label="入库数量" prop="intoQuantity" width="110">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.number="scope.row.intoQuantity" placeholder="入库数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库仓位编码" prop="positionId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.positionId" filterable remote reserve-keyword placeholder="搜索仓位编码"
|
||||
:remote-method="searchLocation" :loading="locationLoading" @change="locationChanage(scope.row)">
|
||||
<el-option v-for="item in locationList" :key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.number }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="scope.row.locationNum" placeholder="请输入入库仓位编码" />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="总入库数量" prop="totalQuantity"></el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<!-- <el-form-item label="操作入库人id" prop="stockInOperatorId">-->
|
||||
<!-- <el-input v-model="form.stockInOperatorId" placeholder="请输入操作入库人id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockIn, getWmsStockInEntry, stockIn ,complete} from "@/api/wms/stockIn";
|
||||
import { listWarehouse,searchPosition } from "@/api/wms/warehouse";
|
||||
|
||||
|
||||
export default {
|
||||
name: "WmsStockInEntry",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedWmsStockInEntryItem: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 入库单表格数据
|
||||
WmsStockInEntryList: [],
|
||||
// 入库单明细表格数据
|
||||
itemList: [
|
||||
],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockInNum: null,
|
||||
stockInType: null,
|
||||
sourceNo: null,
|
||||
sourceId: null,
|
||||
stockInTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
stockInId:null,
|
||||
warehouseId:null
|
||||
},
|
||||
// 仓库列表
|
||||
warehouseList:[],
|
||||
// 仓位列表
|
||||
locationList:[],
|
||||
locationLoading:false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
warehouseId: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
stockInOperator: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleAdd(){
|
||||
this.$router.push({path:"/stock/stock_in/create"})
|
||||
},
|
||||
searchLocation(query){
|
||||
if(!this.form.warehouseId){
|
||||
this.$modal.msgError("请选择仓库")
|
||||
}else{
|
||||
this.locationLoading = true;
|
||||
const qw = {
|
||||
warehouseId:this.form.warehouseId,
|
||||
number: query
|
||||
}
|
||||
searchPosition(qw).then(res => {
|
||||
this.locationList = res.rows;
|
||||
this.locationLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
locationChanage(row){
|
||||
console.log(row)
|
||||
const selection = this.locationList.find(x => x.id === row.positionId);
|
||||
if (selection) {
|
||||
row.positionNum = selection.number
|
||||
}
|
||||
},
|
||||
// qtyChange(row) {
|
||||
// console.log('======值变化=====', row)
|
||||
// if(row.intoQuantity){
|
||||
// row.totalQuantity = parseInt(row.inQuantity) + parseInt(row.intoQuantity)
|
||||
// }else {
|
||||
// row.totalQuantity = row.inQuantity
|
||||
// }
|
||||
//
|
||||
// },
|
||||
/** 查询入库单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStockIn(this.queryParams).then(response => {
|
||||
this.WmsStockInEntryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockInOperator: null,
|
||||
stockInTime: null,
|
||||
};
|
||||
this.itemList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleStockInComplete(row){
|
||||
this.$modal.confirm('确认完成之后就不能再入库了!您确定吗?').then(function() {
|
||||
return complete(row.id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("状态修改成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 入库按钮操作 */
|
||||
handleStockIn(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
|
||||
listWarehouse({status:1}).then(resp=>{
|
||||
this.warehouseList = resp.rows;
|
||||
})
|
||||
getWmsStockInEntry(id).then(response => {
|
||||
// this.form = response.data;
|
||||
this.form.stockInId = response.data.id
|
||||
this.itemList = response.data.itemList;
|
||||
this.itemList.forEach(x=>{
|
||||
x.intoQuantity = x.quantity - x.inQuantity
|
||||
x.positionId = null
|
||||
x.positionNum = null
|
||||
})
|
||||
this.open = true;
|
||||
this.title = "入库操作";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.itemList = this.itemList;
|
||||
// 验证数据
|
||||
let isValid = false
|
||||
for(let i = 0;i<this.form.itemList.length;i++){
|
||||
const x = this.form.itemList[i]
|
||||
if(x.intoQuantity && !x.positionId){
|
||||
isValid = false;
|
||||
break
|
||||
}else if(x.positionId && !x.intoQuantity){
|
||||
isValid = false;
|
||||
break
|
||||
}else isValid = true
|
||||
}
|
||||
|
||||
if(isValid){
|
||||
console.log('=======验证通过了========',this.form)
|
||||
stockIn(this.form).then(response => {
|
||||
this.$modal.msgSuccess("入库操作成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}else{
|
||||
this.$modal.msgError("请填写入库数量和仓位编码");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 入库单明细序号 */
|
||||
rowWmsStockInEntryItemIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="出库单号" prop="stockOutNum">
|
||||
<el-input
|
||||
v-model="queryParams.stockOutNum"
|
||||
placeholder="请输入出库单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="源单号" prop="sourceNo">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.sourceNo"-->
|
||||
<!-- placeholder="请输入来源单据号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="源单Id" prop="sourceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.sourceId"-->
|
||||
<!-- placeholder="请输入来源单据Id"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="打印时间" prop="printTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.printTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择打印时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建日期" prop="createTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.createTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wms:stockOutEntry:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockOutEntryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="出库单号" align="center" prop="stockOutNum" />
|
||||
<!-- <el-table-column label="源单号" align="center" prop="sourceNo" />-->
|
||||
<!-- <el-table-column label="源单Id" align="center" prop="sourceId" />-->
|
||||
<el-table-column label="出库类型" align="center" prop="stockOutType" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.stockOutType === 1">订单拣货出库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.stockOutType === 2">采购退货出库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.stockOutType === 3">盘点出库</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.stockOutType === 4">报损出库</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 0">待拣货</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 1">拣货中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">拣货完成</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 3">已出库</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否打印" align="center" prop="printStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.printStatus === 0">未打印</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.printStatus === 1">已打印</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打印时间" align="center" prop="printTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.printTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建日期" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="创建人" align="center" prop="createBy" />-->
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="更新人" align="center" prop="updateBy" />-->
|
||||
<el-table-column label="完成时间" align="center" prop="completeTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.completeTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="出库操作人userid" align="center" prop="stockOutOperatorId" />-->
|
||||
<el-table-column label="操作人" align="center" prop="stockOutOperatorName" />
|
||||
<!-- <el-table-column label="出库时间" align="center" prop="stockOutTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.stockOutTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="是否删除0未删除1已删除" align="center" prop="isDelete" />-->
|
||||
<el-table-column label="商品数" align="center" prop="goodsUnit" />
|
||||
<el-table-column label="商品规格数" align="center" prop="specUnit" />
|
||||
<el-table-column label="总件数" align="center" prop="specUnitTotal" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-d-arrow-right"
|
||||
@click="handleStockOut(scope.row)"
|
||||
v-hasPermi="['wms:stockOutEntry:edit']"
|
||||
>出库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改出库单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-descriptions title="出库单详情">
|
||||
<el-descriptions-item label="单号">{{form.stockOutNum}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来源">
|
||||
<el-tag size="small" v-if="form.stockOutType === 1">订单拣货出库</el-tag>
|
||||
<el-tag size="small" v-if="form.stockOutType === 2">采购退货出库</el-tag>
|
||||
<el-tag size="small" v-if="form.stockOutType === 3">盘点出库</el-tag>
|
||||
<el-tag size="small" v-if="form.stockOutType === 4">报损出库</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{form.remark}}</el-descriptions-item>
|
||||
<el-descriptions-item label="商品数">{{form.goodsUnit}}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格数">{{form.specUnit}}</el-descriptions-item>
|
||||
<el-descriptions-item label="总件数">{{form.specUnitTotal}}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="店铺">-->
|
||||
<!-- <span v-if="form.shopId==6">梦小妮牛仔裤</span>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<el-divider content-position="center">出库商品明细</el-divider>
|
||||
<el-table :data="wmsStockOutEntryItemList" :row-class-name="rowWmsStockOutEntryItemIndex" ref="wmsStockOutEntryItem">
|
||||
<!-- <el-table-column type="selection" width="50" align="center" />-->
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="商品图片" prop="colorImage" >
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.colorImage"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格编码" prop="specNum"></el-table-column>
|
||||
<el-table-column label="规格" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small">{{scope.row.colorValue}} {{scope.row.sizeValue}} {{scope.row.styleValue}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="originalQuantity"></el-table-column>
|
||||
<el-table-column label="已出库数量" prop="outQuantity"></el-table-column>
|
||||
|
||||
<el-table-column label="出库仓位" prop="inventoryId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.inventoryDetailId" placeholder="请选择出库仓位" v-if="scope.row.status < 2">
|
||||
<el-option v-for="item in scope.row.inventoryDetails" :key="item.id" :label="item.locationNum" :value="item.id">
|
||||
<span style="float: left">{{ item.locationNum }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" >剩余库存:{{ item.currentQty }}</span>
|
||||
|
||||
</el-option>
|
||||
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库数量" prop="outQty" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.number="scope.row.outQty" placeholder="出库数量" v-if="scope.row.status < 2" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库操作" prop="outQuantity" width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status < 2"
|
||||
size="mini"
|
||||
plain
|
||||
type="danger"
|
||||
@click="stockOutSubmit(scope.row)"
|
||||
icon="el-icon-d-arrow-right"
|
||||
>出库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockOut, getStockOutEntry, delStockOutEntry, addStockOutEntry, stockOut } from "@/api/wms/stockOut";
|
||||
|
||||
export default {
|
||||
name: "StockOutEntry",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedWmsStockOutEntryItem: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 出库单表格数据
|
||||
stockOutEntryList: [],
|
||||
// 出库单明细表格数据
|
||||
wmsStockOutEntryItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockOutNum: null,
|
||||
sourceNo: null,
|
||||
sourceId: null,
|
||||
stockOutType: null,
|
||||
status: null,
|
||||
printStatus: null,
|
||||
printTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
completeTime: null,
|
||||
stockOutOperatorId: null,
|
||||
stockOutOperatorName: null,
|
||||
stockOutTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
inventoryId:[{ required: true, message: '请填写收货信息' }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询出库单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStockOut(this.queryParams).then(response => {
|
||||
this.stockOutEntryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
stockOutNum: null,
|
||||
sourceNo: null,
|
||||
sourceId: null,
|
||||
stockOutType: null,
|
||||
status: null,
|
||||
printStatus: null,
|
||||
printTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
completeTime: null,
|
||||
stockOutOperatorId: null,
|
||||
stockOutOperatorName: null,
|
||||
stockOutTime: null,
|
||||
remark: null,
|
||||
isDelete: null,
|
||||
goodsUnit: null,
|
||||
specUnit: null,
|
||||
specUnitTotal: null
|
||||
};
|
||||
this.wmsStockOutEntryItemList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleStockOut(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getStockOutEntry(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.wmsStockOutEntryItemList = response.data.wmsStockOutEntryItemList;
|
||||
// this.wmsStockOutEntryItemList.forEach(x=>{
|
||||
// x.inventoryId = null;
|
||||
// x.outQty = null
|
||||
// })
|
||||
this.open = true;
|
||||
this.title = "出库操作";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
stockOutSubmit(row) {
|
||||
console.log("=====提交出库操作====",row)
|
||||
if(!row.outQty && row.outQty <= 0){
|
||||
this.$modal.msgError("请填写要出库的库存");
|
||||
return
|
||||
}
|
||||
if(!row.inventoryDetailId){
|
||||
this.$modal.msgError("请选择库存仓位");
|
||||
return
|
||||
}else{
|
||||
// 判断填写的数量是否小于等于当前仓位库存
|
||||
// if(row.inventoryId < row.outQty){
|
||||
// this.$modal.msgError("仓位库存不足!");
|
||||
// return
|
||||
// }
|
||||
// 判断输入的数量要小于等于需要出库的数量
|
||||
if(row.outQty > (row.originalQuantity - row.outQuantity)){
|
||||
this.$modal.msgError("出库数量不对!");
|
||||
return
|
||||
}
|
||||
}
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const subForm ={
|
||||
entryItemId:row.id,
|
||||
entryId:row.entryId,
|
||||
specId:row.specId,
|
||||
inventoryDetailId:row.inventoryDetailId,
|
||||
outQty:row.outQty
|
||||
}
|
||||
stockOut(subForm).then(response => {
|
||||
this.$modal.msgSuccess("出库成功");
|
||||
// this.open = false;
|
||||
getStockOutEntry(row.id).then(response => {
|
||||
this.form = response.data;
|
||||
this.wmsStockOutEntryItemList = response.data.wmsStockOutEntryItemList;
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 出库单明细序号 */
|
||||
rowWmsStockOutEntryItemIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/stockOutEntry/export', {
|
||||
...this.queryParams
|
||||
}, `stockOutEntry_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,341 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="仓库编号" prop="number">
|
||||
<el-input
|
||||
v-model="queryParams.number"
|
||||
placeholder="请输入仓库编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货架名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入仓库名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable >
|
||||
<el-option label="启用" value="1"></el-option>
|
||||
<el-option label="禁用" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wms:location: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:location: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:location:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="locationList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" />
|
||||
<el-table-column label="编号" align="center" prop="number" />
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="省市区" align="center" prop="province" >
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.province}}
|
||||
{{scope.row.city}}
|
||||
{{scope.row.district}}
|
||||
{{scope.row.street}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细地址" align="center" prop="address" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="仓位" align="center" prop="remark" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-info"
|
||||
@click="handlePostion(scope.row)"
|
||||
>查看仓位详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 0">禁用</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 1">启用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wms:location:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wms:location:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改仓库货架对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="仓库编号" prop="number">
|
||||
<el-input v-model="form.number" placeholder="请输入货架编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入货架名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="省市区" prop="provinces">
|
||||
<el-cascader style="width:250px"
|
||||
size="large"
|
||||
:options="pcaTextArr"
|
||||
v-model="form.provinces">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="街道" prop="address">
|
||||
<el-input v-model="form.street" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态" clearable >
|
||||
<el-option label="启用" value="1"></el-option>
|
||||
<el-option label="禁用" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listWarehouse, getLocation, delLocation, addLocation, updateLocation } from "@/api/wms/warehouse";
|
||||
import {pcaTextArr} from "element-china-area-data";
|
||||
|
||||
export default {
|
||||
name: "warehouseHome",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 仓库货架表格数据
|
||||
locationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
number: null,
|
||||
name: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
provinces: [],
|
||||
status:'1'
|
||||
},
|
||||
pcaTextArr,
|
||||
// 表单校验
|
||||
rules: {
|
||||
number: [
|
||||
{ required: true, message: "编号不能为空", trigger: "blur" }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "名称不能为空", trigger: "blur" }
|
||||
],
|
||||
provinces: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId1: [
|
||||
{ required: true, message: "一级类目id不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId2: [
|
||||
{ required: true, message: "二级类目id不能为空", trigger: "blur" }
|
||||
],
|
||||
isDelete: [
|
||||
{ required: true, message: "0正常 1删除不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询仓库货架列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listWarehouse(this.queryParams).then(response => {
|
||||
this.locationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
number: null,
|
||||
name: null,
|
||||
parentId: null,
|
||||
depth: null,
|
||||
provinces: [],
|
||||
parentId2: null,
|
||||
address: null,
|
||||
remark: null,
|
||||
status: '1',
|
||||
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加仓库货架";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getLocation(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.provinces = []
|
||||
this.form.provinces.push(response.data.province)
|
||||
this.form.provinces.push(response.data.city)
|
||||
this.form.provinces.push(response.data.district)
|
||||
this.form.status = response.data.status+''
|
||||
this.open = true;
|
||||
this.title = "修改仓库";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.province = this.form.provinces[0]
|
||||
this.form.city = this.form.provinces[1]
|
||||
this.form.district = this.form.provinces[2]
|
||||
if (this.form.id != null) {
|
||||
updateLocation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addLocation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除仓库ID编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delLocation(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** */
|
||||
handlePostion(row) {
|
||||
this.$router.push({path:"/stock/position",query:{warehouseId:row.id}})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,363 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
|
||||
<!-- <el-form-item label="货架编号" prop="number">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.number"-->
|
||||
<!-- placeholder="请输入货架编号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="货架名称" prop="name">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.name"-->
|
||||
<!-- placeholder="请输入货架名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item label="0正常 1删除" prop="isDelete">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.isDelete"-->
|
||||
<!-- placeholder="请输入0正常 1删除"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
|
||||
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-hasPermi="['wms:location: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:location: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:location: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:location:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<el-table v-loading="loading" :data="locationList" row-key="id" :tree-props="{children: 'children'}" default-expand-all @selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="仓位编号" align="center" prop="number" />
|
||||
<el-table-column label="仓位名称" align="center" prop="name" />
|
||||
<!-- <el-table-column label="上级id" align="center" prop="parentId" />-->
|
||||
<!-- <el-table-column label="层级深度1级2级3级" align="center" prop="depth" />-->
|
||||
<!-- <el-table-column label="一级类目id" align="center" prop="parentId1" />-->
|
||||
<!-- <el-table-column label="二级类目id" align="center" prop="parentId2" />-->
|
||||
<!-- <el-table-column label="地址" align="center" prop="address" />-->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="0正常 1删除" align="center" prop="isDelete" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['goods:category:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wms:location:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wms:location:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="total>0"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- :page.sync="queryParams.pageNum"-->
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
|
||||
<!-- 添加或修改仓库货架对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="仓位编号" prop="number">
|
||||
<el-input v-model="form.number" placeholder="请输入仓位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓位名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入仓位名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="上级id" prop="parentId">-->
|
||||
<!-- <el-input v-model="form.parentId" placeholder="请输入上级id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="层级深度1级2级3级" prop="depth">-->
|
||||
<!-- <el-input v-model="form.depth" placeholder="请输入层级深度1级2级3级" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="一级类目id" prop="parentId1">-->
|
||||
<!-- <el-input v-model="form.parentId1" placeholder="请输入一级类目id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="二级类目id" prop="parentId2">-->
|
||||
<!-- <el-input v-model="form.parentId2" placeholder="请输入二级类目id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="地址" prop="address">-->
|
||||
<!-- <el-input v-model="form.address" placeholder="请输入地址" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除" prop="isDelete">
|
||||
<!-- <el-input v-model="form.isDelete" placeholder="请输入0正常 1删除" />-->
|
||||
<el-select v-model="form.isDelete" placeholder="是否删除" clearable >
|
||||
<el-option label="删除" value="1"></el-option>
|
||||
<el-option label="正常" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPosition, getLocation, delLocation, addLocation, updateLocation } from "@/api/wms/position";
|
||||
|
||||
export default {
|
||||
name: "warehousePosition",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 仓库货架表格数据
|
||||
locationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
warehouseId:null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
warehouseId:null,
|
||||
isDelete: '0',
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
number: [
|
||||
{ required: true, message: "货架编号不能为空", trigger: "blur" }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "货架名称不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId: [
|
||||
{ required: true, message: "上级id不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId1: [
|
||||
{ required: true, message: "一级类目id不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId2: [
|
||||
{ required: true, message: "二级类目id不能为空", trigger: "blur" }
|
||||
],
|
||||
isDelete: [
|
||||
{ required: true, message: "0正常 1删除不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.query.warehouseId) {
|
||||
this.queryParams.warehouseId = this.$route.query.warehouseId
|
||||
|
||||
}else{
|
||||
this.queryParams.warehouseId = 1;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buildTree(list, parentId) {
|
||||
let tree = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].parentId === parentId) {
|
||||
let node = {
|
||||
id: list[i].id,
|
||||
name: list[i].name,
|
||||
number:list[i].number,
|
||||
sort:list[i].sort,
|
||||
remark:list[i].remark,
|
||||
parentId:list[i].parentId,
|
||||
isDelete:list[i].isDelete,
|
||||
children: this.buildTree(list, list[i].id)
|
||||
};
|
||||
tree.push(node);
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
},
|
||||
/** 查询仓库货架列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPosition(this.queryParams).then(response => {
|
||||
// this.locationList = response.rows;
|
||||
this.locationList = this.buildTree(response.rows,0 )
|
||||
console.log("构建后的list",this.locationList)
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
number: null,
|
||||
name: null,
|
||||
parentId: null,
|
||||
warehouseId:null,
|
||||
remark: null,
|
||||
isDelete: '0',
|
||||
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.reset();
|
||||
this.form.warehouseId = this.queryParams.warehouseId
|
||||
this.form.parentId = row.id
|
||||
this.open = true;
|
||||
this.title = "添加仓库仓位";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getLocation(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.isDelete = response.data.isdelete+''
|
||||
this.open = true;
|
||||
this.title = "修改仓库仓位";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateLocation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addLocation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除仓库货架编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delLocation(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/location/export', {
|
||||
...this.queryParams
|
||||
}, `location_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -7,7 +7,7 @@ function resolve(dir) {
|
|||
|
||||
const CompressionPlugin = require('compression-webpack-plugin')
|
||||
|
||||
const name = process.env.VUE_APP_TITLE || '启航电商OMS系统' // 网页标题
|
||||
const name = process.env.VUE_APP_TITLE || '启航电商ERP系统' // 网页标题
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 88 // 端口
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue