| | |
| | | public PlaceTypeEnum StorageTypeNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 货位类型 |
| | | /// </summary> |
| | | public string StorageTypeNoDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(StorageTypeNo); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 货位状态 |
| | | /// </summary> |
| | | public PlaceStatusEnum PlaceStatus { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 货位状态 |
| | | /// </summary> |
| | | public string PlaceStatusDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(PlaceStatus); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 所在库区 |
| | |
| | | public YesNoEnum Islock { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 是否锁定 |
| | | /// </summary> |
| | | public string IslockDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(Islock); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否空托 |
| | | /// </summary> |
| | | public YesNoEnum EmptyContainer { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 是否空托 |
| | | /// </summary> |
| | | public string EmptyContainerDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(EmptyContainer); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 冗余字段1 - 预留扩展用途 |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var count = await _wmsplaceRepository.GetCountAsync(input.Filter, specification); |
| | | var list = await _wmsplaceRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | var place = ObjectMapper.Map<GetWmsPlacesInput, WmsPlace>(input); |
| | | var count = await _wmsplaceRepository.GetCountAsync(place,input.Filter, specification); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsPlaceDto>(count, ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list)); |
| | | } |
| | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsplaceRepository.GetListAsync(nameof(WmsPlace.Sort)); |
| | | var list = await _wmsplaceRepository.GetListAsync(null,nameof(WmsPlace.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var list = await _wmsplaceRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var place = ObjectMapper.Map<GetWmsPlacesInput, WmsPlace>(input); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["配置"] = result.Select(x => x.GetExportData()).ToList(), |
| | | ["配置"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsPlace列表" : result.Count == 1 ? result.First()?.PlaceNo : "WmsPlace模版"; |
| | |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsPlace, WmsPlaceDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsPlaceCreateDto, WmsPlace>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsPlacesInput, WmsPlace>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
| | |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsPlace>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsPlace> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | 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> |
| | | /// Gets the count asynchronous. |
| | |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default); |
| | | Task<long> GetCountAsync(WmsPlace? place, string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default); |
| | | } |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.AspNetCore.Components.Forms; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsPlace>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsPlace> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | public async 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) |
| | | { |
| | | specification ??= new WmsPlaceSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.PlaceNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo == 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) |
| | | .WhereIf(place.RowNo > 0, u => u.RowNo == place.RowNo) |
| | | .WhereIf(place.ColumnNo > 0, u => u.ColumnNo == place.ColumnNo) |
| | | .WhereIf(place.LayerNo > 0, u => u.LayerNo == place.LayerNo) |
| | | .WhereIf(place.Islock > 0, u => u.Islock == place.Islock) |
| | | .WhereIf(place.EmptyContainer > 0, u => u.EmptyContainer == place.EmptyContainer) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsPlace.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default) |
| | | public async Task<long> GetCountAsync(WmsPlace? place, string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsPlaceSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo == 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) |
| | | .WhereIf(place.RowNo > 0, u => u.RowNo == place.RowNo) |
| | | .WhereIf(place.ColumnNo > 0, u => u.ColumnNo == place.ColumnNo) |
| | | .WhereIf(place.LayerNo > 0, u => u.LayerNo == place.LayerNo) |
| | | .WhereIf(place.Islock > 0, u => u.Islock == place.Islock) |
| | | .WhereIf(place.EmptyContainer > 0, u => u.EmptyContainer == place.EmptyContainer) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.PlaceNo.Contains(filter)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | |
| | | export const getWmsDataList = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsmaterial/page', data) |
| | | } |
| | | |
| | | /** |
| | | * 获取仓库列表 |
| | | * @returns |
| | | */ |
| | | export const getStoreDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/StoreList') |
| | | } |
| | | |
| | | /** |
| | | * 获取库区列表 |
| | | * @returns |
| | | */ |
| | | export const getAreaAreaDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/AreaList') |
| | | } |
| | |
| | | label: '托盘编号', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | disabled: disabled, |
| | | placeholder: '请输入托盘编号', |
| | | rules: [{ required: true, message: '托盘编号不能为空', trigger: 'blur' }], |
| | | }, |
| | |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | import { |
| | | getWmsEnumData, |
| | | getStoreDataList, |
| | | } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | |
| | | export const useWmsAreaDrawer = (props: any, ctx?: any) => { |
| | | const wmsAreaDrawer = injectModel<WmsAreaDrawer>('wmsAreaDrawer') |
| | |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | |
| | | label: '库区编号', |
| | | prop: 'areaNo', |
| | | el: 'input', |
| | | disabled: disabled, |
| | | placeholder: '请输入库区编号', |
| | | rules: [{ required: true, message: '库区编号不能为空', trigger: 'blur' }], |
| | | }, |
| | |
| | | label: '库区状态', |
| | | prop: 'areaStatus', |
| | | el: 'select', |
| | | options: [ |
| | | { label: '启用', value: 'Active' }, |
| | | { label: '禁用', value: 'Inactive' }, |
| | | // 根据实际的 AreaStatusEnum 添加更多选项 |
| | | ], |
| | | options: [], |
| | | placeholder: '请选择库区状态', |
| | | rules: [ |
| | | { required: true, message: '库区状态不能为空', trigger: 'change' }, |
| | |
| | | label: '库区类型', |
| | | prop: 'areaType', |
| | | el: 'select', |
| | | options: [ |
| | | { label: '存储区', value: 'Storage' }, |
| | | { label: '装卸区', value: 'Loading' }, |
| | | // 根据实际的 AreaTypeEnum 添加更多选项 |
| | | ], |
| | | options: [], |
| | | placeholder: '请选择库区类型', |
| | | rules: [ |
| | | { required: true, message: '库区类型不能为空', trigger: 'change' }, |
| | |
| | | { |
| | | label: '仓库代码', |
| | | prop: 'storeCode', |
| | | el: 'input', |
| | | el: 'select', |
| | | options: [], |
| | | placeholder: '请输入仓库代码', |
| | | }, |
| | | { |
| | |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | const updateFormStoreOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.StoreCode, |
| | | value: item.StoreName, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * 弹窗打开获取详情 |
| | | */ |
| | | const onOpen = async () => { |
| | | const areaStatusEnum = await getWmsEnumData({ |
| | | EnumName: 'AreaStatusEnum', |
| | | }) |
| | | updateFormItemOptions('areaStatus', areaStatusEnum) |
| | | |
| | | const areaTypeEnum = await getWmsEnumData({ |
| | | EnumName: 'AreaTypeEnum', |
| | | }) |
| | | updateFormItemOptions('areaType', areaTypeEnum) |
| | | |
| | | const storeList = await getStoreDataList() |
| | | updateFormItemOptions('storeCode', storeList) |
| | | if (current.value) { |
| | | const res = await wmsAreaDrawer.getWmsAreaDetail(current.value) |
| | | |
| | |
| | | remark: res.remark, // 备注 |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | disabled.value = false |
| | | formData.value = {} |
| | | updateCheckData() |
| | | } |
| | |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | |
| | | label: '仓库代码', |
| | | prop: 'storeCode', |
| | | el: 'input', |
| | | disabled: disabled, |
| | | placeholder: '请输入仓库代码', |
| | | rules: [{ required: true, message: '仓库代码', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '仓库名称', |
| | | prop: 'storeCode', |
| | | prop: 'storeName', |
| | | el: 'input', |
| | | placeholder: '请输入仓库名称', |
| | | rules: [{ required: true, message: '仓库名称', trigger: 'blur' }], |
| | |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | const data = { |
| | | name: formData.value.name, |
| | | code: formData.value.code, |
| | | storeName: formData.value.storeName, |
| | | storeCode: formData.value.storeCode, |
| | | remark: formData.value.remark, |
| | | sort: props.sort, |
| | | } |
| | |
| | | const res = await wmsStoreDrawer.getWmsStoreDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
| | | code: res.code, |
| | | storeName: res.storeName, |
| | | storeCode: res.storeCode, |
| | | remark: res.remark, |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | disabled.value = false |
| | | formData.value = {} |
| | | updateCheckData() |
| | | } |