| | |
| | | {F405C633-8100-49B8-A270-D5340A165742} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {A68B3B6B-DDE8-431E-90F3-A9FEE1D14A53} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 仓库名称 |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 仓库代码 |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 冗余字段1 - 预留扩展用途 |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 编号 |
| | | /// </summary> |
| | | public virtual string PlaceNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货位类型 |
| | | /// </summary> |
| | | public PlaceTypeEnum? StorageTypeNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货位状态 |
| | | /// </summary> |
| | | public PlaceStatusEnum? PlaceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 所在库区 |
| | | /// </summary> |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 巷道 |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 排 |
| | | /// </summary> |
| | | public int? RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 列 |
| | | /// </summary> |
| | | public int? ColumnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 层 |
| | | /// </summary> |
| | | public int? LayerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否锁定 |
| | | /// </summary> |
| | | public YesNoEnum? Islock { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否空托 |
| | | /// </summary> |
| | | public YesNoEnum? EmptyContainer { get; set; } |
| | | } |
| | |
| | | public WmsPlaceCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 巷道列表 |
| | | /// </summary> |
| | | public class PlaceAisleForListOuptut |
| | | { |
| | | /// <summary> |
| | | /// 巷道编号 |
| | | /// </summary> |
| | | public int Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 巷道名称 |
| | | /// </summary> |
| | | public string AisleName { get; set; } |
| | | } |
| | | } |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces.WmsPlaceCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services |
| | | { |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<AreaForListOuptut>> GetAreaListAsync(); |
| | | |
| | | /// <summary> |
| | | /// 巷道列表. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<PlaceAisleForListOuptut>> GetAisleListAsync(); |
| | | } |
| | | } |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | |
| | | public class WmsAreaAppService : CMSPluginAppService, IWmsAreaAppService |
| | | { |
| | | private readonly IWmsAreaRepository _wmsareaRepository; |
| | | private readonly IWmsStoreRepository _wmsstoreRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsareaRepository">The task job repository.</param> |
| | | public WmsAreaAppService(IWmsAreaRepository wmsareaRepository) |
| | | public WmsAreaAppService(IWmsAreaRepository wmsareaRepository, IWmsStoreRepository wmsstoreRepository) |
| | | { |
| | | _wmsareaRepository = wmsareaRepository; |
| | | _wmsstoreRepository = wmsstoreRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsarea = ObjectMapper.Map<WmsAreaCreateDto, WmsArea>(input); |
| | | wmsarea.Sort = sort; |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | var store = await _wmsstoreRepository.FindByNameAsync(input.StoreCode); |
| | | if (store == null) |
| | | { |
| | | throw new UserFriendlyException("仓库信息不存"); |
| | | } |
| | | |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | wmsarea.StoreName = store.StoreName; |
| | | await _wmsareaRepository.InsertAsync(wmsarea); |
| | | |
| | | if (input.Sort.HasValue && wmsarea.Sort != maxSort) |
| | |
| | | |
| | | wmsarea.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | var store = await _wmsstoreRepository.FindByNameAsync(input.StoreCode); |
| | | if (store == null) |
| | | { |
| | | throw new UserFriendlyException("仓库信息不存"); |
| | | } |
| | | |
| | | wmsarea.AreaName = input.AreaName; |
| | | wmsarea.AreaDesc = input.AreaDesc; |
| | | wmsarea.AreaStatus = input.AreaStatus; |
| | | wmsarea.AreaType = input.AreaType; |
| | | wmsarea.StoreCode = input.StoreCode; |
| | | wmsarea.StoreName = input.StoreName; |
| | | wmsarea.StoreName = store.StoreName; |
| | | |
| | | await _wmsareaRepository.UpdateAsync(wmsarea); |
| | | |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces.WmsPlaceCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements |
| | | { |
| | |
| | | { |
| | | private readonly IWmsStoreRepository _storeRepository; |
| | | private readonly IWmsAreaRepository _wmsAreaRepository; |
| | | private readonly IWmsPlaceRepository _wmsPlaceRepository; |
| | | |
| | | public WmsEnumAppService(IWmsStoreRepository storeRepository, IWmsAreaRepository wmsAreaRepository) |
| | | public WmsEnumAppService(IWmsStoreRepository storeRepository, IWmsAreaRepository wmsAreaRepository, IWmsPlaceRepository wmsPlaceRepository) |
| | | { |
| | | _storeRepository = storeRepository; |
| | | _wmsAreaRepository = wmsAreaRepository; |
| | | _wmsPlaceRepository = wmsPlaceRepository; |
| | | } |
| | | |
| | | public List<EnumItem> GetEnumDataList(WmsEnumInput enumInput) |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 巷道列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<PlaceAisleForListOuptut>> GetAisleListAsync() |
| | | { |
| | | var list = await _wmsPlaceRepository.GetAisleListForSelectAsync(); |
| | | if (list == null || list.Count <= 0) { return new List<PlaceAisleForListOuptut>(); } |
| | | |
| | | var result = list.Select(x => new PlaceAisleForListOuptut |
| | | { |
| | | Aisle = x.Aisle, |
| | | AisleName = $"第{x.Aisle}巷道", |
| | | }).ToList(); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsArea>> GetListAsync(WmsArea? area, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsArea> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取库区列表 |
| | | /// </summary> |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | |
| | | Task<List<WmsPlace>> GetListAsync(WmsPlace? place, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsPlace> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// 获取巷道列表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsPlace>> GetAisleListForSelectAsync(CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.AspNetCore.Components.Forms; |
| | |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.PlaceNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo == place.PlaceNo) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo.Contains(place.PlaceNo)) |
| | | .WhereIf(place.PlaceStatus > 0, u => u.PlaceStatus == place.PlaceStatus) |
| | | .WhereIf(place.StorageTypeNo > 0, u => u.StorageTypeNo == place.StorageTypeNo) |
| | | .WhereIf(place.Aisle > 0, u => u.Aisle == place.Aisle) |
| | |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取巷道列表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsPlace>> GetAisleListForSelectAsync(CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(WmsPlace? place, string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsStore> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | public virtual async Task<WmsStore> FindByNameAsync(string storeCode, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.StoreCode == name, GetCancellationToken(cancellationToken)); |
| | | .FirstOrDefaultAsync(t => t.StoreCode == storeCode, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | |
| | | using System; |
| | | using System.Web; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces.WmsPlaceCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | |
| | | { |
| | | return await _wmsEnumAppService.GetAreaListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 巷道列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("AisleList")] |
| | | public async Task<List<PlaceAisleForListOuptut>> GetAisleListAsync() |
| | | { |
| | | return await _wmsEnumAppService.GetAisleListAsync(); |
| | | } |
| | | } |
| | | } |
| | |
| | | export const getAreaAreaDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/AreaList') |
| | | } |
| | | |
| | | /** |
| | | * 获取巷道列表 |
| | | * @returns |
| | | */ |
| | | export const getAisleDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/AisleList') |
| | | } |
| | |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | { |
| | | label: '向上添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'up', |
| | | }, |
| | | { |
| | | label: '向下添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'down', |
| | | }, |
| | | { |
| | | label: '创建副本', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await wmsArea.cloneData([row.id]) |
| | | ElMessage.success('创建副本成功') |
| | | tableRef.value?.getList() |
| | | }, |
| | | divided: true, |
| | | icon: 'copy', |
| | | }, |
| | | // { |
| | | // label: '向上添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: '向下添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: '创建副本', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsArea.cloneData([row.id]) |
| | | // ElMessage.success('创建副本成功') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: '删除', |
| | | fn: async (c: CurrentType) => { |
| | |
| | | prop: 'storeCode', |
| | | el: 'select', |
| | | options: [], |
| | | // storeValueAndLabel: true, |
| | | placeholder: '请输入仓库代码', |
| | | }, |
| | | { |
| | |
| | | */ |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | console.log(formData.value) |
| | | const data = { |
| | | areaNo: formData.value.areaNo, // 库区编号 |
| | | areaName: formData.value.areaName, // 库区名称 |
| | |
| | | areaStatus: formData.value.areaStatus, // 库区状态 |
| | | areaType: formData.value.areaType, // 库区类型 |
| | | storeCode: formData.value.storeCode, // 仓库代码 |
| | | storeName: formData.value.storeName, // 仓库名称 |
| | | // storeName: formData.value.storeName, // 仓库名称 |
| | | remark: formData.value.remark, // 备注 |
| | | } |
| | | console.log(data) |
| | | if (!current.value) { |
| | | await wmsAreaDrawer.addWmsArea(data) |
| | | } else { |
| | |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.StoreCode, |
| | | value: item.StoreName, |
| | | label: item.storeName, |
| | | value: item.storeCode, |
| | | })) |
| | | } |
| | | } |
| | |
| | | updateFormItemOptions('areaType', areaTypeEnum) |
| | | |
| | | const storeList = await getStoreDataList() |
| | | updateFormItemOptions('storeCode', storeList) |
| | | updateFormStoreOptions('storeCode', storeList) |
| | | if (current.value) { |
| | | const res = await wmsAreaDrawer.getWmsAreaDetail(current.value) |
| | | |
| | |
| | | areaStatus: res.areaStatus, // 库区状态 |
| | | areaType: res.areaType, // 库区类型 |
| | | storeCode: res.storeCode, // 仓库代码 |
| | | storeName: res.storeName, // 仓库名称 |
| | | // storeName: res.storeName, // 仓库名称 |
| | | remark: res.remark, // 备注 |
| | | id: res.id, |
| | | } |
| | |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | { |
| | | label: '向上添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'up', |
| | | }, |
| | | { |
| | | label: '向下添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'down', |
| | | }, |
| | | { |
| | | label: '创建副本', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await wmsStore.cloneData([row.id]) |
| | | ElMessage.success('创建副本成功') |
| | | tableRef.value?.getList() |
| | | }, |
| | | divided: true, |
| | | icon: 'copy', |
| | | }, |
| | | // { |
| | | // label: '向上添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: '向下添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: '创建副本', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsStore.cloneData([row.id]) |
| | | // ElMessage.success('创建副本成功') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: '删除', |
| | | fn: async (c: CurrentType) => { |
| | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | | margin-bottom: 0px; |
| | | border-radius: 4px; |
| | | |
| | | .el-form-item { |
| | | margin-right: 20px; |
| | | margin-bottom: 0; |
| | | |
| | | // 统一输入框和选择框的宽度 |
| | | .el-input, .el-select { |
| | | width: 200px; // 设置统一的宽度 |
| | | } |
| | | |
| | | // 选择框内部输入框样式 |
| | | .el-select .el-input__wrapper { |
| | | height: 32px; // 与输入框高度一致 |
| | | padding: 1px 11px; // 与输入框内边距一致 |
| | | } |
| | | |
| | | // 日期选择器宽度 |
| | | .el-date-editor { |
| | | width: 220px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果需要更精确的控制,可以单独设置 |
| | | .formItem { |
| | | width: 200px; |
| | | |
| | | &.el-input, &.el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | |
| | | import { defineComponent } from 'vue' |
| | | import { computed, defineComponent, onMounted, reactive, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './WmsArea.module.scss' |
| | |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | | import { vPermission } from '@/libs/Permission/Permission' |
| | | import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus' |
| | | import { |
| | | getWmsEnumData, |
| | | getStoreDataList, |
| | | } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | |
| | | interface RenderTableType { |
| | | url?: string |
| | |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsArea(props, ctx) |
| | | |
| | | // 新增的查询条件 |
| | | const queryForm = ref({ |
| | | areaNo: '', |
| | | areaName: '', |
| | | areaType: '', |
| | | areaStatus: '', |
| | | filter: '', |
| | | }) |
| | | |
| | | const queryParams = computed(() => ({ |
| | | ...queryForm.value, |
| | | areaType: queryForm.value.areaType || '', // 处理下拉 |
| | | areaStatus: queryForm.value.areaStatus || '', |
| | | })) |
| | | |
| | | // 动态枚举选项 |
| | | const enumOptions = reactive({ |
| | | areaType: [] as Array<{ label: string; value: any }>, |
| | | areaStatus: [] as Array<{ label: string; value: any }>, |
| | | }) |
| | | |
| | | // 获取枚举数据 |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | // 获取物料类型枚举 |
| | | const areaTypeData = await getWmsEnumData({ |
| | | EnumName: 'AreaTypeEnum', |
| | | }) |
| | | enumOptions.areaType = areaTypeData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | // 获取采购类型枚举 |
| | | const areaStatusData = await getWmsEnumData({ |
| | | EnumName: 'AreaStatusEnum', |
| | | }) |
| | | enumOptions.areaStatus = areaStatusData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } catch (error) { |
| | | console.error('获取枚举数据失败:', error) |
| | | } |
| | | } |
| | | |
| | | // 组件挂载时获取枚举数据 |
| | | onMounted(() => { |
| | | fetchEnumData() |
| | | }) |
| | | |
| | | // 新增的查询方法 |
| | | const handleQuery = async () => { |
| | | // tableRef.value.getTableList() |
| | | tableRef.value.getList(queryParams.value) |
| | | } |
| | | |
| | | // 重置查询条件 |
| | | const resetQuery = () => { |
| | | queryForm.value = { |
| | | areaNo: '', |
| | | areaName: '', |
| | | areaType: '', |
| | | areaStatus: '', |
| | | filter: '', |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @returns 表格 |
| | |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsArea} |
| | | /> |
| | | {/* 新增的查询表单 */} |
| | | <ElForm |
| | | inline |
| | | model={queryForm.value} |
| | | class={styles.queryForm} |
| | | label-width="80px" |
| | | > |
| | | <ElFormItem label="关键字"> |
| | | <ElInput |
| | | v-model={queryForm.value.filter} |
| | | placeholder="请输入关键字搜索" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="库区编码"> |
| | | <ElInput |
| | | v-model={queryForm.value.areaNo} |
| | | placeholder="请输入库区编码" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="库区名称"> |
| | | <ElInput |
| | | v-model={queryForm.value.areaName} |
| | | placeholder="请输入库区名称" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="库位类型"> |
| | | <ElSelect |
| | | v-model={queryForm.value.areaType} |
| | | placeholder="请选择托盘类型" |
| | | clearable |
| | | loading={enumOptions.areaType.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.areaType.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="库区状态"> |
| | | <ElSelect |
| | | v-model={queryForm.value.areaStatus} |
| | | placeholder="请选择托盘状态" |
| | | clearable |
| | | loading={enumOptions.areaStatus.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.areaStatus.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | {/* <ElFormItem label="日期范围"> |
| | | <ElDatePicker |
| | | v-model={queryForm.value.dateRange} |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </ElFormItem> */} |
| | | <ElFormItem> |
| | | <IconButton type="primary" icon="search" onClick={handleQuery}> |
| | | 查询 |
| | | </IconButton> |
| | | <IconButton |
| | | style="margin-left: 10px;" |
| | | icon="refresh" |
| | | onClick={resetQuery} |
| | | > |
| | | 重置 |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | |
| | | 导出 |
| | | </IconButton> |
| | | </div> |
| | | <Search |
| | | {/* <Search |
| | | placeholder="请输入关键字" |
| | | v-model={search.value} |
| | | onConfirm={onSearch} |
| | | style={{ marginTop: '-1px' }} |
| | | /> |
| | | /> */} |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/HIAWms/wmsArea" |
| | |
| | | .wmsPlaceContent { |
| | | width: 100%; |
| | | height: 90%; |
| | | height: 85%; |
| | | |
| | | .wmsPlaceList { |
| | | width: 100%; |
| | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | | margin-bottom: 0px; |
| | | border-radius: 4px; |
| | | |
| | | .el-form-item { |
| | | margin-right: 20px; |
| | | margin-bottom: 0; |
| | | |
| | | // 统一输入框和选择框的宽度 |
| | | .el-input, .el-select { |
| | | width: 200px; // 设置统一的宽度 |
| | | } |
| | | |
| | | // 选择框内部输入框样式 |
| | | .el-select .el-input__wrapper { |
| | | height: 32px; // 与输入框高度一致 |
| | | padding: 1px 11px; // 与输入框内边距一致 |
| | | } |
| | | |
| | | // 日期选择器宽度 |
| | | .el-date-editor { |
| | | width: 220px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果需要更精确的控制,可以单独设置 |
| | | .formItem { |
| | | width: 200px; |
| | | |
| | | &.el-input, &.el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | |
| | | import { defineComponent } from 'vue' |
| | | import { defineComponent, onMounted, ref, computed, reactive } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './WmsPlace.module.scss' |
| | |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | | import { vPermission } from '@/libs/Permission/Permission' |
| | | import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus' |
| | | import { |
| | | getWmsEnumData, |
| | | getAreaAreaDataList, |
| | | getAisleDataList, |
| | | } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | |
| | | interface RenderTableType { |
| | | url?: string |
| | |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsPlace(props, ctx) |
| | | |
| | | // 新增的查询条件 |
| | | const queryForm = ref({ |
| | | placeNo: '', |
| | | storageTypeNo: '', |
| | | placeStatus: '', |
| | | areaCode: '', |
| | | aisle: '', |
| | | islock: '', |
| | | emptyContainer: '', |
| | | filter: '', |
| | | }) |
| | | |
| | | const queryParams = computed(() => ({ |
| | | ...queryForm.value, |
| | | storageTypeNo: queryForm.value.storageTypeNo || '', // 处理下拉 |
| | | placeStatus: queryForm.value.placeStatus || '', |
| | | })) |
| | | |
| | | // 动态枚举选项 |
| | | const enumOptions = reactive({ |
| | | storageTypeNo: [] as Array<{ label: string; value: any }>, |
| | | placeStatus: [] as Array<{ label: string; value: any }>, |
| | | yesOrNo: [] as Array<{ label: string; value: any }>, |
| | | }) |
| | | |
| | | let areaTypelist = [] as Array<{ label: string; value: any }> |
| | | let aisleTypelist = [] as Array<{ label: string; value: any }> |
| | | |
| | | // 获取枚举数据 |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | // 获取物料类型枚举 |
| | | const storageTypeNoData = await getWmsEnumData({ |
| | | EnumName: 'PlaceTypeEnum', |
| | | }) |
| | | enumOptions.storageTypeNo = storageTypeNoData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | // 获取采购类型枚举 |
| | | const placeStatusData = await getWmsEnumData({ |
| | | EnumName: 'PlaceStatusEnum', |
| | | }) |
| | | enumOptions.placeStatus = placeStatusData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | const yesNoData = await getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | enumOptions.yesOrNo = yesNoData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } catch (error) { |
| | | console.error('获取枚举数据失败:', error) |
| | | } |
| | | } |
| | | const getAreaType = async () => { |
| | | try { |
| | | const areaListData = await getAreaAreaDataList() |
| | | areaTypelist = areaListData.map((item) => ({ |
| | | label: item.areaName || '', |
| | | value: item.areaNo || '', // 同上 |
| | | })) |
| | | } catch (error) { |
| | | areaTypelist = [] // 失败时重置为空数组 |
| | | } |
| | | } |
| | | |
| | | const getAisleList = async () => { |
| | | try { |
| | | const aisleListData = await getAisleDataList() |
| | | aisleTypelist = aisleListData.map((item) => ({ |
| | | label: item.aisleName || '', |
| | | value: item.aisle || '', |
| | | })) |
| | | } catch (error) { |
| | | console.error('获取巷道列表失败:', error) |
| | | aisleTypelist = [] // 失败时重置为空数组 |
| | | } |
| | | } |
| | | // 组件挂载时获取枚举数据 |
| | | onMounted(() => { |
| | | fetchEnumData() |
| | | getAreaType() |
| | | getAisleList() |
| | | }) |
| | | |
| | | // 新增的查询方法 |
| | | const handleQuery = async () => { |
| | | console.log('查询条件:', queryParams.value) |
| | | // tableRef.value.getTableList() |
| | | tableRef.value.getList(queryParams.value) |
| | | } |
| | | |
| | | // 重置查询条件 |
| | | const resetQuery = () => { |
| | | queryForm.value = { |
| | | placeNo: '', |
| | | storageTypeNo: '', |
| | | placeStatus: '', |
| | | aisle: '', |
| | | areaCode: '', |
| | | islock: '', |
| | | emptyContainer: '', |
| | | filter: '', |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @returns 表格 |
| | |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsPlace} |
| | | /> |
| | | {/* 新增的查询表单 */} |
| | | <ElForm |
| | | inline |
| | | model={queryForm.value} |
| | | class={styles.queryForm} |
| | | label-width="80px" |
| | | > |
| | | <ElFormItem label="关键字"> |
| | | <ElInput |
| | | v-model={queryForm.value.filter} |
| | | placeholder="请输入关键字搜索" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="库位编码"> |
| | | <ElInput |
| | | v-model={queryForm.value.placeNo} |
| | | placeholder="请输入库位编码" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="库位类型"> |
| | | <ElSelect |
| | | v-model={queryForm.value.storageTypeNo} |
| | | placeholder="请选择托盘类型" |
| | | clearable |
| | | loading={enumOptions.storageTypeNo.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.storageTypeNo.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="库位状态"> |
| | | <ElSelect |
| | | v-model={queryForm.value.placeStatus} |
| | | placeholder="请选择托盘状态" |
| | | clearable |
| | | loading={enumOptions.placeStatus.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.placeStatus.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="库区"> |
| | | <ElSelect |
| | | v-model={queryForm.value.areaCode} |
| | | placeholder="请选择库区" |
| | | clearable |
| | | loading={areaTypelist.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {areaTypelist.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="巷道"> |
| | | <ElSelect |
| | | v-model={queryForm.value.aisle} |
| | | placeholder="请选择库区" |
| | | clearable |
| | | loading={aisleTypelist.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {aisleTypelist.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="是否锁定"> |
| | | <ElSelect |
| | | v-model={queryForm.value.islock} |
| | | placeholder="请选择是否锁定" |
| | | clearable |
| | | loading={enumOptions.yesOrNo.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.yesOrNo.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="是否空托"> |
| | | <ElSelect |
| | | v-model={queryForm.value.emptyContainer} |
| | | placeholder="请选择是否空托" |
| | | clearable |
| | | loading={enumOptions.yesOrNo.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.yesOrNo.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem> |
| | | <IconButton type="primary" icon="search" onClick={handleQuery}> |
| | | 查询 |
| | | </IconButton> |
| | | <IconButton |
| | | style="margin-left: 10px;" |
| | | icon="refresh" |
| | | onClick={resetQuery} |
| | | > |
| | | 重置 |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | |
| | | import { defineComponent } from 'vue' |
| | | import { defineComponent, reactive, ref, computed } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './WmsStore.module.scss' |
| | |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | | import { vPermission } from '@/libs/Permission/Permission' |
| | | import { ElForm, ElFormItem, ElInput } from 'element-plus' |
| | | import { getWmsEnumData } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | |
| | | interface RenderTableType { |
| | | url?: string |
| | |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsStore(props, ctx) |
| | | |
| | | // 新增的查询条件 |
| | | const queryForm = ref({ |
| | | storeCode: '', |
| | | storeName: '', |
| | | filter: '', |
| | | }) |
| | | |
| | | const queryParams = computed(() => ({ |
| | | ...queryForm.value, |
| | | })) |
| | | |
| | | // 新增的查询方法 |
| | | const handleQuery = async () => { |
| | | console.log('查询条件:', queryParams.value) |
| | | // tableRef.value.getTableList() |
| | | tableRef.value.getList(queryParams.value) |
| | | } |
| | | |
| | | // 重置查询条件 |
| | | const resetQuery = () => { |
| | | queryForm.value = { |
| | | storeCode: '', |
| | | storeName: '', |
| | | filter: '', |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @returns 表格 |
| | |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsStore} |
| | | /> |
| | | |
| | | {/* 新增的查询表单 */} |
| | | <ElForm |
| | | inline |
| | | model={queryForm.value} |
| | | class={styles.queryForm} |
| | | label-width="80px" |
| | | > |
| | | <ElFormItem label="关键字"> |
| | | <ElInput |
| | | v-model={queryForm.value.filter} |
| | | placeholder="请输入关键字搜索" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="仓库编码"> |
| | | <ElInput |
| | | v-model={queryForm.value.storeCode} |
| | | placeholder="请输入仓库编码" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="仓库名称"> |
| | | <ElInput |
| | | v-model={queryForm.value.storeName} |
| | | placeholder="请输入仓库名称" |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem> |
| | | <IconButton type="primary" icon="search" onClick={handleQuery}> |
| | | 查询 |
| | | </IconButton> |
| | | <IconButton |
| | | style="margin-left: 10px;" |
| | | icon="refresh" |
| | | onClick={resetQuery} |
| | | > |
| | | 重置 |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |