¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表æ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class GetWmsTaskInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | |
| | | #region å
³é®åæ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// å
³é®åæ¨¡ç³æ¥è¯¢ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public string searchVal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨æ¥è¯¢é
ç½® (1:æ¨¡ç³æ¥è¯¢ , 2:ç²¾åæ¥è¯¢)ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public SearchFilterModeEnum searchVal_FilterMode { get; set; } = SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | [NoAutoQuery] |
| | | public string str_searchFormInputAttrs { get; set; } |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public List<string> searchFormInputAttrs |
| | | { |
| | | get |
| | | { |
| | | if (!string.IsNullOrEmpty(str_searchFormInputAttrs)) |
| | | { |
| | | return str_searchFormInputAttrs.Split(',').ToList(); |
| | | } |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Aisle_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum CreatorId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum DeleterId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> DeletionTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºID-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum DodeviceId_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | public int? Dodevicetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Dodevicetype_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool? IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDeleted_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDisabled_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸ªä»»å¡æ¯å¦çææå |
| | | /// </summary> |
| | | public int? IsNextTask { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸ªä»»å¡æ¯å¦çææå-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsNextTask_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | public bool? IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsRead_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LastModifierId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1 |
| | | /// </summary> |
| | | public string MutableParam1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MutableParam1_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2 |
| | | /// </summary> |
| | | public string MutableParam2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MutableParam2_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3 |
| | | /// </summary> |
| | | public string MutableParam3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MutableParam3_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public int? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SonTaskType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Sort_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | public string SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SourceOrderNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SourcePlace_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int? TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskDodeviceStatus_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int? TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskLevel_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int? TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskStatus_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public int? TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ToPlace_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表åå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsTaskCreateDto : WmsTaskCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using System; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表åå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsTaskCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | public int Dodevicetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸ªä»»å¡æ¯å¦çææå |
| | | /// </summary> |
| | | public int? IsNextTask { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | public bool IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1 |
| | | /// </summary> |
| | | public string? MutableParam1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2 |
| | | /// </summary> |
| | | public string? MutableParam2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3 |
| | | /// </summary> |
| | | public string? MutableParam3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public SonTaskTypeEnum? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | public string? SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public WmsTaskStatus TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsTaskCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsTaskCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡çè¡¨æ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsTaskDto: ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? DeletionTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | public int Dodevicetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ExtraPropertyDictionary? ExtraProperties { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸ªä»»å¡æ¯å¦çææå |
| | | /// </summary> |
| | | public int? IsNextTask { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | public bool IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1 |
| | | /// </summary> |
| | | public string? MutableParam1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2 |
| | | /// </summary> |
| | | public string? MutableParam2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3 |
| | | /// </summary> |
| | | public string? MutableParam3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public SonTaskTypeEnum? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public string? SonTaskTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(SonTaskType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | public string? SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public WmsTaskStatus TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public string TaskStatusDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(TaskStatus); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public string TaskTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(TaskType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡çè¡¨å¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsTaskExportModel |
| | | { |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å··é", Width = 25)] |
| | | public int? Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æçç¼å·", Width = 25)] |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å åæºID", Width = 25)] |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "设å¤ç±»å", Width = 25)] |
| | | public int Dodevicetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ç¦ç¨", Width = 25)] |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸ªä»»å¡æ¯å¦çææå |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä¸ä¸ªä»»å¡æ¯å¦çææå", Width = 25)] |
| | | public int? IsNextTask { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "WCSæ¯å¦å¯ä»¥è¯»å", Width = 25)] |
| | | public bool IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å¯ååé1", Width = 25)] |
| | | public string MutableParam1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å¯ååé2", Width = 25)] |
| | | public string MutableParam2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å¯ååé3", Width = 25)] |
| | | public string MutableParam3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä»»å¡ç±»å", Width = 25)] |
| | | public SonTaskTypeEnum? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æåº", Width = 25)] |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¥æºåæ®å·", Width = 25)] |
| | | public string SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "èµ·å§åºä½", Width = 25)] |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "设å¤ä»»å¡ç¶æ", Width = 25)] |
| | | public int TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡ç级", Width = 25)] |
| | | public int TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡å·", Width = 25)] |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡ç¶æ", Width = 25)] |
| | | public WmsTaskStatus TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡ç±»å", Width = 25)] |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç®æ åºä½", Width = 25)] |
| | | public string ToPlace { get; set; } |
| | | |
| | | |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡çè¡¨æ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsTaskUpdateDto : WmsTaskCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask |
| | | { |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsTasksImportModel |
| | | { |
| | | private List<WmsTaskImportModel> _WmsTasks = new(); |
| | | |
| | | public List<WmsTaskImportModel> WmsTasks |
| | | { |
| | | get => _WmsTasks; |
| | | set |
| | | { |
| | | _WmsTasks = value; |
| | | var rowIndex = 2; |
| | | _WmsTasks?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsTaskImportModel : WmsTaskExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表åºç¨æå¡æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsTaskAppService : ICrudAppService<WmsTaskDto, Guid, GetWmsTaskInput, WmsTaskCreateDto, WmsTaskUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// å
éWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsTaskDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// å é¤Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// 导å
¥Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsTasksImportModel input); |
| | | |
| | | /// <summary> |
| | | /// 导åºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsTaskInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表åºç¨æå¡ |
| | | /// </summary> |
| | | public class WmsTaskAppService : CMSPluginAppService, IWmsTaskAppService |
| | | { |
| | | private readonly IWmsTaskRepository wmsTaskRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsTaskAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WmsTaskRepository">The task job repository.</param> |
| | | public WmsTaskAppService(IWmsTaskRepository _WmsTaskRepository) |
| | | { |
| | | wmsTaskRepository = _WmsTaskRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå®Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsTaskDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(await wmsTaskRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·åWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<PagedResultDto<WmsTaskDto>> GetListAsync(GetWmsTaskInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsTask.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await wmsTaskRepository.GetCountAsync(whereConditions); |
| | | var list = await wmsTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WmsTaskDto>(count, ObjectMapper.Map<List<WmsTask>, List<WmsTaskDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WmsTask, bool>>> DynamicGetQueryParams(GetWmsTaskInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WmsTask, GetWmsTaskInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WmsTask, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WmsTask, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsTaskDto> CreateAsync(WmsTaskCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await wmsTaskRepository.NameExistAsync(input.TaskNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskNo]); |
| | | } |
| | | |
| | | var maxSort = await wmsTaskRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WmsTaskCreateDto, WmsTask>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await wmsTaskRepository.InsertAsync(insertObj); |
| | | |
| | | if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(insertObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsTaskDto> UpdateAsync(Guid id, WmsTaskUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await wmsTaskRepository.GetAsync(id); |
| | | var exist = await wmsTaskRepository.NameExistAsync(input.TaskNo, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskNo]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.Aisle = input.Aisle; |
| | | updateObj.ContainerNo = input.ContainerNo; |
| | | updateObj.DodeviceId = input.DodeviceId; |
| | | updateObj.Dodevicetype = input.Dodevicetype; |
| | | updateObj.IsDisabled = input.IsDisabled; |
| | | updateObj.IsNextTask = input.IsNextTask; |
| | | updateObj.IsRead = input.IsRead; |
| | | updateObj.MutableParam1 = input.MutableParam1; |
| | | updateObj.MutableParam2 = input.MutableParam2; |
| | | updateObj.MutableParam3 = input.MutableParam3; |
| | | updateObj.SonTaskType = input.SonTaskType; |
| | | updateObj.SourceOrderNo = input.SourceOrderNo; |
| | | updateObj.SourcePlace = input.SourcePlace; |
| | | updateObj.TaskDodeviceStatus = input.TaskDodeviceStatus; |
| | | updateObj.TaskLevel = input.TaskLevel; |
| | | updateObj.TaskNo = input.TaskNo; |
| | | updateObj.TaskStatus = input.TaskStatus; |
| | | updateObj.TaskType = input.TaskType; |
| | | updateObj.ToPlace = input.ToPlace; |
| | | |
| | | |
| | | await wmsTaskRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(updateObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsTaskDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | //var wmsTasks = new List<WmsTask>(); |
| | | //if (ids != null) |
| | | //{ |
| | | // var sort = await wmsTaskRepository.GetMaxSortAsync(); |
| | | // foreach (var id in ids) |
| | | // { |
| | | // var WmsTask = await wmsTaskRepository.FindAsync(id); |
| | | // if (WmsTask != null) |
| | | // { |
| | | // var name = WmsTask.Name + WmsTaskConsts.CloneTag; |
| | | // var notExist = false; |
| | | // while (!notExist) |
| | | // { |
| | | // var exist = await wmsTaskRepository.NameExistAsync(name); |
| | | // if (exist || wmsTasks.Any(x => x.Name == name)) |
| | | // { |
| | | // name += WmsTaskConsts.CloneTag; |
| | | // continue; |
| | | // } |
| | | |
| | | // notExist = true; |
| | | // } |
| | | |
| | | // //WmsTask = await wmsTaskRepository.InsertAsync(WmsTask.Clone(GuidGenerator.Create(), name, sort++)); |
| | | // wmsTasks.Add(WmsTask); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //return ObjectMapper.Map<List<WmsTask>, List<WmsTaskDto>>(wmsTasks); |
| | | return new List<WmsTaskDto>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å个Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return wmsTaskRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å¤ä¸ªWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await wmsTaskRepository.GetListAsync(null, nameof(WmsTask.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await wmsTaskRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WmsTasksImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsTaskCreateDtos = new List<(int RowIndex, WmsTaskCreateDto Item)>(); |
| | | var wmsTaskUpdateDtos = new List<(int RowIndex, Guid Id, WmsTaskUpdateDto Item)>(); |
| | | var importItems = input.WmsTasks; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsTasks = importItems.GroupBy(x => x.TaskNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsTasks?.Any() == true) |
| | | { |
| | | var duplicateWmsTaskMsgs = duplicateWmsTasks.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsTaskMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.TaskNo.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.TaskNo.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WmsTaskåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsTask = await wmsTaskRepository.FindByNameAsync(impItem.TaskNo); |
| | | if (oldWmsTask != null) |
| | | { |
| | | var wmsTaskUpdateDto = new WmsTaskUpdateDto |
| | | { |
| | | Aisle = impItem.Aisle, |
| | | ContainerNo = impItem.ContainerNo, |
| | | DodeviceId = impItem.DodeviceId, |
| | | Dodevicetype = impItem.Dodevicetype, |
| | | IsDisabled = impItem.IsDisabled, |
| | | IsNextTask = impItem.IsNextTask, |
| | | IsRead = impItem.IsRead, |
| | | MutableParam1 = impItem.MutableParam1, |
| | | MutableParam2 = impItem.MutableParam2, |
| | | MutableParam3 = impItem.MutableParam3, |
| | | SonTaskType = impItem.SonTaskType, |
| | | SourceOrderNo = impItem.SourceOrderNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | TaskDodeviceStatus = impItem.TaskDodeviceStatus, |
| | | TaskLevel = impItem.TaskLevel, |
| | | TaskNo = impItem.TaskNo, |
| | | TaskStatus = impItem.TaskStatus, |
| | | TaskType = impItem.TaskType, |
| | | ToPlace = impItem.ToPlace, |
| | | |
| | | }; |
| | | |
| | | wmsTaskUpdateDtos.Add((impItem.RowIndex, oldWmsTask.Id, wmsTaskUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsTaskCreateDto = new WmsTaskCreateDto |
| | | { |
| | | Aisle = impItem.Aisle, |
| | | ContainerNo = impItem.ContainerNo, |
| | | DodeviceId = impItem.DodeviceId, |
| | | Dodevicetype = impItem.Dodevicetype, |
| | | IsDisabled = impItem.IsDisabled, |
| | | IsNextTask = impItem.IsNextTask, |
| | | IsRead = impItem.IsRead, |
| | | MutableParam1 = impItem.MutableParam1, |
| | | MutableParam2 = impItem.MutableParam2, |
| | | MutableParam3 = impItem.MutableParam3, |
| | | SonTaskType = impItem.SonTaskType, |
| | | SourceOrderNo = impItem.SourceOrderNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | TaskDodeviceStatus = impItem.TaskDodeviceStatus, |
| | | TaskLevel = impItem.TaskLevel, |
| | | TaskNo = impItem.TaskNo, |
| | | TaskStatus = impItem.TaskStatus, |
| | | TaskType = impItem.TaskType, |
| | | ToPlace = impItem.ToPlace, |
| | | |
| | | }; |
| | | |
| | | wmsTaskCreateDtos.Add((impItem.RowIndex, wmsTaskCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsTaskDto in wmsTaskCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsTaskDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsTaskDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsTaskDto in wmsTaskUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsTaskDto.Id, wmsTaskDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsTaskDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsTaskInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsTask.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await wmsTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsTask>, List<WmsTaskDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "Wmsä»»å¡ç®¡ç表å表" : result.Count == 1 ? result[0]?.TaskNo : "WmsTask模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªWmsä»»å¡ç®¡ç表ï¼å½æ°å»ºææ´æ°æ¶ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsTaskCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNull(input.Dodevicetype, "设å¤ç±»å"); |
| | | Check.NotNull(input.IsRead, "WCSæ¯å¦å¯ä»¥è¯»å"); |
| | | Check.NotNull(input.TaskDodeviceStatus, "设å¤ä»»å¡ç¶æ"); |
| | | Check.NotNull(input.TaskLevel, "ä»»å¡ç级"); |
| | | Check.NotNullOrWhiteSpace(input.TaskNo, "ä»»å¡å·", 50); |
| | | Check.NotNull(input.TaskStatus, "ä»»å¡ç¶æ"); |
| | | Check.NotNull(input.TaskType, "ä»»å¡ç±»å"); |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | using CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsTaskAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsTaskAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsTaskAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsTask, WmsTaskDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsTaskCreateDto, WmsTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsTaskInput, WmsTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表ä»å¨ |
| | | /// </summary> |
| | | public interface IWmsTaskRepository : IBasicRepository<WmsTask, Guid> |
| | | { |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<WmsTask> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// è·åå页å表Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsTask>> GetListAsync(FunReturnResultModel<Expression<Func<WmsTask, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsTask, bool>>> whereConditions, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表ä»å¨å®ç° |
| | | /// </summary> |
| | | public class EfCoreWmsTaskRepository : EfCoreRepository<ICMSPluginDbContext, WmsTask, Guid>, IWmsTaskRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsTaskRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsTaskRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsTask> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.TaskNo == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="name">æ ¡éªå¼</param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> NameExistAsync(string name, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.TaskNo == name); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åå页å表Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsTask>> GetListAsync(FunReturnResultModel<Expression<Func<WmsTask, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsTask.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsTask, bool>>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetQueryableAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsTask>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsTask; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// Wmsä»»å¡ç®¡ç表æå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsTaskController : ControllerBase |
| | | { |
| | | private readonly IWmsTaskAppService _wmsTaskAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsTaskController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsTaskAppService">The wmsTask application service.</param> |
| | | public WmsTaskController(IWmsTaskAppService wmsTaskAppService) |
| | | { |
| | | _wmsTaskAppService = wmsTaskAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsTaskDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsTaskAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·åWmsä»»å¡ç®¡ç表çå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | | public virtual Task<PagedResultDto<WmsTaskDto>> GetListAsync([FromQuery] GetWmsTaskInput input) |
| | | { |
| | | return _wmsTaskAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsTaskDto> CreateAsync(WmsTaskCreateDto input) |
| | | { |
| | | return _wmsTaskAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsTaskDto> UpdateAsync(Guid id, WmsTaskUpdateDto input) |
| | | { |
| | | return _wmsTaskAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsTaskDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsTaskAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsTaskAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsTaskAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsTaskAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥Wmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsTaskRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsTasksImportModel.WmsTaskImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsTaskRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsTaskAppService.ImportAsync(new WmsTasksImportModel |
| | | { |
| | | WmsTasks = wmsTaskRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºWmsä»»å¡ç®¡ç表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsTaskInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsTaskAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsTaskå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsTaskå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
| | |
| | | export const menu: Record<string,any>[] = [ |
| | | { |
| | | "name": "Wmsä»»å¡ç®¡ç", |
| | | "path": "/information-base/WmsTask", |
| | | "patchName": "WmsTask", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "ä»åºä¿¡æ¯", |
| | | "path": "/information-base/WmsStoreInfo", |
| | | "patchName": "WmsStoreInfo", |
| | |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "åºåä¿¡æ¯", |
| | | "path": "/information-base/WmsMaterialStock", |
| | | "patchName": "WmsMaterialStock", |
| | | "name": "åºå
¥åºè®°å½", |
| | | "path": "/information-base/WmsInOutStockRecord", |
| | | "patchName": "WmsInOutStockRecord", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "åºå
¥åºè®°å½", |
| | | "path": "/information-base/WmsInOutStockRecord", |
| | | "patchName": "WmsInOutStockRecord", |
| | | "name": "åºåä¿¡æ¯", |
| | | "path": "/information-base/WmsMaterialStock", |
| | | "patchName": "WmsMaterialStock", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | |
| | | } |
| | | ]; |
| | | export const menuMap: Record<string,any> = { |
| | | "WmsTask": { |
| | | "name": "Wmsä»»å¡ç®¡ç", |
| | | "path": "/information-base/WmsTask", |
| | | "patchName": "WmsTask", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsStoreInfo": { |
| | | "name": "ä»åºä¿¡æ¯", |
| | | "path": "/information-base/WmsStoreInfo", |
| | |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsMaterialStock": { |
| | | "name": "åºåä¿¡æ¯", |
| | | "path": "/information-base/WmsMaterialStock", |
| | | "patchName": "WmsMaterialStock", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsInOutStockRecord": { |
| | | "name": "åºå
¥åºè®°å½", |
| | | "path": "/information-base/WmsInOutStockRecord", |
| | |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsMaterialStock": { |
| | | "name": "åºåä¿¡æ¯", |
| | | "path": "/information-base/WmsMaterialStock", |
| | | "patchName": "WmsMaterialStock", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsContainer": { |
| | | "name": "Wmsæç管ç", |
| | | "path": "/information-base/WmsContainer", |
| | |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'orderNo', |
| | | title: 'åæ®ç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialName', |
| | | title: 'ç©æåç§°', |
| | | }, |
| | | { |
| | | field: 'materialNo', |
| | | title: 'ç©æä»¶å·', |
| | | }, |
| | | { |
| | | field: 'stockTypeDesc', |
| | | title: 'æä½ç±»å', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: '容å¨ç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialModel', |
| | | title: 'æºå', |
| | | }, |
| | | { |
| | | field: 'operateTime', |
| | | title: 'æä½æ¶é´', |
| | | }, |
| | | { |
| | | field: 'remark', |
| | | title: '夿³¨', |
| | | }, |
| | | { |
| | | field: 'materialId', |
| | | title: 'ç©æID', |
| | | }, |
| | | { |
| | | field: 'taskNo', |
| | | title: 'ä»»å¡å·', |
| | | }, |
| | | { |
| | | field: 'sourcePlace', |
| | | title: 'èµ·å§åºä½', |
| | | }, |
| | | { |
| | | field: 'toPlace', |
| | | title: 'ç®æ åºä½', |
| | | }, |
| | | { |
| | | field: 'creationTime', |
| | | title: '', |
| | | }, |
| | | { |
| | | field: 'deletionTime', |
| | | title: '', |
| | | }, |
| | | ] |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'orderNo', |
| | | title: 'åæ®ç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialName', |
| | | title: 'ç©æåç§°', |
| | | }, |
| | | { |
| | | field: 'materialNo', |
| | | title: 'ç©æä»¶å·', |
| | | }, |
| | | { |
| | | field: 'stockTypeDesc', |
| | | title: 'æä½ç±»å', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: '容å¨ç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialModel', |
| | | title: 'æºå', |
| | | }, |
| | | { |
| | | field: 'operateTime', |
| | | title: 'æä½æ¶é´', |
| | | }, |
| | | { |
| | | field: 'remark', |
| | | title: '夿³¨', |
| | | }, |
| | | { |
| | | field: 'materialId', |
| | | title: 'ç©æID', |
| | | }, |
| | | { |
| | | field: 'taskNo', |
| | | title: 'ä»»å¡å·', |
| | | }, |
| | | { |
| | | field: 'sourcePlace', |
| | | title: 'èµ·å§åºä½', |
| | | }, |
| | | { |
| | | field: 'toPlace', |
| | | title: 'ç®æ åºä½', |
| | | }, |
| | | // { |
| | | // field: 'deletionTime', |
| | | // title: '', |
| | | // }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { importFileToService, exportFileToClient } from '@/api/file' |
| | | import { ElMessage } from 'element-plus' |
| | | import { downloadFile } from '@/utils' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export const useFile = () => { |
| | | /** |
| | | * 导å
¥æä»¶ |
| | | * @param url |
| | | */ |
| | | const importFile = async (url: string, file: File) => { |
| | | const formData = new FormData() |
| | | formData.append('file', file) |
| | | await importFileToService(url, formData) |
| | | ElMessage('导å
¥æå') |
| | | } |
| | | /** |
| | | * å¯¼åºæä»¶ |
| | | * @param url |
| | | */ |
| | | const exportFile = async (url: string, params: any, name: string) => { |
| | | const res = await exportFileToClient(url, params) |
| | | downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) |
| | | ElMessage.success('å¯¼åºæå') |
| | | } |
| | | |
| | | return { |
| | | importFile, |
| | | exportFile, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsTask } from '../Models/WmsTask' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsTask = (props: any, ctx?: any) => { |
| | | const wmsTask = injectModel<WmsTask>('wmsTask') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsTaskColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | | const search = ref('') |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | const sort = ref(0) |
| | | /** |
| | | * 鿩项 |
| | | */ |
| | | const selection = ref([]) |
| | | /** |
| | | * å½åéä¸çè¡ |
| | | */ |
| | | const current = ref<any>(null) |
| | | /** |
| | | * æ°æ®æº |
| | | */ |
| | | const dataSource: Ref<any[]> = ref([]) |
| | | |
| | | /** |
| | | * è¡¨æ ¼ |
| | | */ |
| | | const tableRef = ref() |
| | | const dialogConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | const dialogConfigForQuery = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | |
| | | |
| | | const dialogSettingConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | }) |
| | | |
| | | /** |
| | | * åé¡µæ°æ® |
| | | */ |
| | | const paginationParams = ref({}) |
| | | |
| | | /** |
| | | * æå¼è¯¦æ
|
| | | * @param row |
| | | */ |
| | | const openDetail = (row: any) => { |
| | | current.value = row |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = row.name |
| | | dialogConfig.isAdd = false |
| | | sort.value = row.sort |
| | | } |
| | | |
| | | const contextMenu = [ |
| | | { |
| | | label: 'å±å¼è¯¦æ
', |
| | | fn: (c: CurrentType) => { |
| | | current.value = null |
| | | sort.value = c.row.sort |
| | | nextTick(() => openDetail(c.row)) |
| | | }, |
| | | 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 wmsTask.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { taskNo: string }) => item.taskNo) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.taskNo}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await wmsTask.deleteWmsTasks(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsTask = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | | dialogConfig.isAdd = true |
| | | dialogConfig.title = 'æ·»å ' |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | //ç¹å»æé®ãé«çº§æ¥è¯¢ã |
| | | const onAdvancedQuery = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfigForQuery.visible = true |
| | | dialogConfigForQuery.isAdd = true |
| | | dialogConfigForQuery.title = 'é«çº§æ¥è¯¢' |
| | | } |
| | | |
| | | const onConfirmWmsTask = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | | skip: true, |
| | | }) |
| | | } else { |
| | | await tableRef.value?.getList() |
| | | } |
| | | } |
| | | /** |
| | | * è¡ç¹å»æ¶æ´æ°current |
| | | */ |
| | | const onRowClick = ({ row }: any) => { |
| | | if (dialogConfig.visible && current.value) { |
| | | current.value = row |
| | | } |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | const onExport = (data={}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsTask/export', data, 'HIAWms') |
| | | } |
| | | |
| | | /** |
| | | * å
³é®åæç´¢ |
| | | */ |
| | | const onSearch = () => { |
| | | tableRef.value?.getList({ |
| | | Filter: search.value, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * éç½®è¡¨æ ¼æ°æ® |
| | | */ |
| | | const reloadList = () => { |
| | | tableRef.value?.getList() |
| | | } |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | const onSuccess = () => { |
| | | tableRef.value?.getList() |
| | | ElMessage.success('导å
¥æå') |
| | | } |
| | | /** |
| | | * 失败 |
| | | * @param err |
| | | */ |
| | | const onError = (err: any) => { |
| | | try { |
| | | const message = JSON.parse(err.message) |
| | | ElMessage.error(message.msg) |
| | | } catch (error) { |
| | | ElMessage.error('导å
¥å¤±è´¥') |
| | | } |
| | | } |
| | | /** |
| | | * ä¸ä¼ é©å |
| | | */ |
| | | const onBeforeUpload = (file: File) => { |
| | | const format = ['xlsx', 'xls', 'csv'] |
| | | if (!format.includes(file.name.split('.')[1])) { |
| | | ElMessage.error('导å
¥æä»¶æ ¼å¼ä¸æ£ç¡®ï¼è¯·å¯¼å
¥.xlsx/.xlsä¸.csvæ ¼å¼çæä»¶') |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | headers.value = { |
| | | Authorization: `Bearer ${sessionStorage.getItem('Token')}`, |
| | | 'X-Project': sessionStorage.getItem('X-Project'), |
| | | } |
| | | }) |
| | | |
| | | ctx.expose({ |
| | | reloadList, |
| | | }) |
| | | |
| | | return { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | dialogSettingConfig, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | wmsTaskColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsTask, |
| | | onCheck, |
| | | onAddWmsTask, |
| | | onAdvancedQuery |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsTaskDrawer } from '../Models/WmsTaskDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsTaskDrawer = (props: any, ctx?: any) => { |
| | | const wmsTaskDrawer = injectModel<WmsTaskDrawer>('wmsTaskDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const inputNumber = (attrs) => { |
| | | return ( |
| | | <el-input-number |
| | | min="1" |
| | | step="1" |
| | | precision="0" |
| | | {...attrs} |
| | | ></el-input-number> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'å··é', |
| | | prop: 'aisle', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å··é', |
| | | }, |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | }, |
| | | { |
| | | label: 'å åæºID', |
| | | prop: 'dodeviceId', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å åæºID', |
| | | }, |
| | | { |
| | | label: '设å¤ç±»å', |
| | | prop: 'dodevicetype', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è®¾å¤ç±»å', |
| | | rules: [{required: true, message: '设å¤ç±»åä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä¸ä¸ªä»»å¡æ¯å¦çææå', |
| | | prop: 'isNextTask', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¸ä¸ªä»»å¡æ¯å¦çææå', |
| | | }, |
| | | { |
| | | label: 'WCSæ¯å¦å¯ä»¥è¯»å', |
| | | prop: 'isRead', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WCSæ¯å¦å¯ä»¥è¯»å', |
| | | rules: [{required: true, message: 'WCSæ¯å¦å¯ä»¥è¯»åä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'å¯ååé1', |
| | | prop: 'mutableParam1', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé1', |
| | | }, |
| | | { |
| | | label: 'å¯ååé2', |
| | | prop: 'mutableParam2', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé2', |
| | | }, |
| | | { |
| | | label: 'å¯ååé3', |
| | | prop: 'mutableParam3', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé3', |
| | | }, |
| | | { |
| | | label: 'åä»»å¡ç±»å', |
| | | prop: 'sonTaskType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä»»å¡ç±»å', |
| | | }, |
| | | { |
| | | label: 'æ¥æºåæ®å·', |
| | | prop: 'sourceOrderNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æ¥æºåæ®å·', |
| | | }, |
| | | { |
| | | label: 'èµ·å§åºä½', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥èµ·å§åºä½', |
| | | }, |
| | | { |
| | | label: '设å¤ä»»å¡ç¶æ', |
| | | prop: 'taskDodeviceStatus', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è®¾å¤ä»»å¡ç¶æ', |
| | | rules: [{required: true, message: '设å¤ä»»å¡ç¶æä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç级', |
| | | prop: 'taskLevel', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç级', |
| | | rules: [{required: true, message: 'ä»»å¡ç级ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä»»å¡å·', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡å·', |
| | | rules: [{required: true, message: 'ä»»å¡å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç¶æ', |
| | | prop: 'taskStatus', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç¶æ', |
| | | rules: [{required: true, message: 'ä»»å¡ç¶æä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç±»å', |
| | | prop: 'taskType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç±»å', |
| | | rules: [{required: true, message: 'ä»»å¡ç±»åä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç®æ åºä½', |
| | | prop: 'toPlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç®æ åºä½', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | if (checkIsEqualObject()) { |
| | | visible.value = false |
| | | done && done() |
| | | } else { |
| | | ConfirmBox('æ¯å¦ä¿å设置ï¼') |
| | | .then(() => { |
| | | onConfirm() |
| | | }) |
| | | .catch(() => { |
| | | visible.value = false |
| | | done && done() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * ä¿å |
| | | */ |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | const data = { |
| | | aisle: formData.value.aisle, |
| | | containerNo: formData.value.containerNo, |
| | | dodeviceId: formData.value.dodeviceId, |
| | | dodevicetype: formData.value.dodevicetype, |
| | | isNextTask: formData.value.isNextTask, |
| | | isRead: formData.value.isRead, |
| | | mutableParam1: formData.value.mutableParam1, |
| | | mutableParam2: formData.value.mutableParam2, |
| | | mutableParam3: formData.value.mutableParam3, |
| | | sonTaskType: formData.value.sonTaskType, |
| | | sourceOrderNo: formData.value.sourceOrderNo, |
| | | sourcePlace: formData.value.sourcePlace, |
| | | taskDodeviceStatus: formData.value.taskDodeviceStatus, |
| | | taskLevel: formData.value.taskLevel, |
| | | taskNo: formData.value.taskNo, |
| | | taskStatus: formData.value.taskStatus, |
| | | taskType: formData.value.taskType, |
| | | toPlace: formData.value.toPlace, |
| | | } |
| | | if (!current.value) { |
| | | await wmsTaskDrawer.addWmsTask(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsTaskDrawer.updateWmsTask(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | 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 commonQueryEnumForFrom = async () => { |
| | | const taskTypeEnumEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'TaskTypeEnum', |
| | | }) |
| | | updateFormItemOptions('taskType', taskTypeEnumEnum) |
| | | const wmsTaskStatusEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'WmsTaskStatus', |
| | | }) |
| | | updateFormItemOptions('taskStatus', wmsTaskStatusEnum) |
| | | const sonTaskTypeEnumEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'SonTaskTypeEnum', |
| | | }) |
| | | updateFormItemOptions('sonTaskType', sonTaskTypeEnumEnum) |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await wmsTaskDrawer.getWmsTaskDetail(current.value) |
| | | |
| | | formData.value = { |
| | | aisle: res.aisle, |
| | | containerNo: res.containerNo, |
| | | dodeviceId: res.dodeviceId, |
| | | dodevicetype: res.dodevicetype, |
| | | isNextTask: res.isNextTask, |
| | | isRead: res.isRead, |
| | | mutableParam1: res.mutableParam1, |
| | | mutableParam2: res.mutableParam2, |
| | | mutableParam3: res.mutableParam3, |
| | | sonTaskType: res.sonTaskType, |
| | | sourceOrderNo: res.sourceOrderNo, |
| | | sourcePlace: res.sourcePlace, |
| | | taskDodeviceStatus: res.taskDodeviceStatus, |
| | | taskLevel: res.taskLevel, |
| | | taskNo: res.taskNo, |
| | | taskStatus: res.taskStatus, |
| | | taskType: res.taskType, |
| | | toPlace: res.toPlace, |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | formData.value = {} |
| | | |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirm, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsTaskDrawer } from '../Models/WmsTaskDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsTaskQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsTaskDrawer = injectModel<WmsTaskDrawer>('WmsTaskDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const inputNumber = (attrs) => { |
| | | return ( |
| | | <el-input-number |
| | | min="1" |
| | | step="1" |
| | | precision="0" |
| | | {...attrs} |
| | | ></el-input-number> |
| | | ) |
| | | } |
| | | |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'å··é', |
| | | prop: 'aisle', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å··é', |
| | | }, |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | }, |
| | | { |
| | | label: 'å åæºID', |
| | | prop: 'dodeviceId', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å åæºID', |
| | | }, |
| | | { |
| | | label: '设å¤ç±»å', |
| | | prop: 'dodevicetype', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è®¾å¤ç±»å', |
| | | }, |
| | | { |
| | | label: 'ä¸ä¸ªä»»å¡æ¯å¦çææå', |
| | | prop: 'isNextTask', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¸ä¸ªä»»å¡æ¯å¦çææå', |
| | | }, |
| | | { |
| | | label: 'WCSæ¯å¦å¯ä»¥è¯»å', |
| | | prop: 'isRead', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WCSæ¯å¦å¯ä»¥è¯»å', |
| | | }, |
| | | { |
| | | label: 'å¯ååé1', |
| | | prop: 'mutableParam1', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé1', |
| | | }, |
| | | { |
| | | label: 'å¯ååé2', |
| | | prop: 'mutableParam2', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé2', |
| | | }, |
| | | { |
| | | label: 'å¯ååé3', |
| | | prop: 'mutableParam3', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¯ååé3', |
| | | }, |
| | | { |
| | | label: 'åä»»å¡ç±»å', |
| | | prop: 'sonTaskType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä»»å¡ç±»å', |
| | | }, |
| | | { |
| | | label: 'æ¥æºåæ®å·', |
| | | prop: 'sourceOrderNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æ¥æºåæ®å·', |
| | | }, |
| | | { |
| | | label: 'èµ·å§åºä½', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥èµ·å§åºä½', |
| | | }, |
| | | { |
| | | label: '设å¤ä»»å¡ç¶æ', |
| | | prop: 'taskDodeviceStatus', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è®¾å¤ä»»å¡ç¶æ', |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç级', |
| | | prop: 'taskLevel', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç级', |
| | | }, |
| | | { |
| | | label: 'ä»»å¡å·', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡å·', |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç¶æ', |
| | | prop: 'taskStatus', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç¶æ', |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç±»å', |
| | | prop: 'taskType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡ç±»å', |
| | | }, |
| | | { |
| | | label: 'ç®æ åºä½', |
| | | prop: 'toPlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç®æ åºä½', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData=()=>{ |
| | | const data = { |
| | | Aisle: formData.value.Aisle, |
| | | ContainerNo: formData.value.ContainerNo, |
| | | DodeviceId: formData.value.DodeviceId, |
| | | Dodevicetype: formData.value.Dodevicetype, |
| | | IsNextTask: formData.value.IsNextTask, |
| | | IsRead: formData.value.IsRead, |
| | | MutableParam1: formData.value.MutableParam1, |
| | | MutableParam2: formData.value.MutableParam2, |
| | | MutableParam3: formData.value.MutableParam3, |
| | | SonTaskType: formData.value.SonTaskType, |
| | | SourceOrderNo: formData.value.SourceOrderNo, |
| | | SourcePlace: formData.value.SourcePlace, |
| | | TaskDodeviceStatus: formData.value.TaskDodeviceStatus, |
| | | TaskLevel: formData.value.TaskLevel, |
| | | TaskNo: formData.value.TaskNo, |
| | | TaskStatus: formData.value.TaskStatus, |
| | | TaskType: formData.value.TaskType, |
| | | ToPlace: formData.value.ToPlace, |
| | | } |
| | | return data; |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data =commonGetFormData(); |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | | /** |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data =commonGetFormData(); |
| | | ctx.emit('confirmQuery', data) |
| | | } |
| | | /** |
| | | * éç½®æ¥è¯¢ |
| | | */ |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | formData.value.Aisle = '' |
| | | formData.value.ContainerNo = '' |
| | | formData.value.DodeviceId = '' |
| | | formData.value.Dodevicetype = '' |
| | | formData.value.IsNextTask = '' |
| | | formData.value.IsRead = '' |
| | | formData.value.MutableParam1 = '' |
| | | formData.value.MutableParam2 = '' |
| | | formData.value.MutableParam3 = '' |
| | | formData.value.SonTaskType = '' |
| | | formData.value.SourceOrderNo = '' |
| | | formData.value.SourcePlace = '' |
| | | formData.value.TaskDodeviceStatus = '' |
| | | formData.value.TaskLevel = '' |
| | | formData.value.TaskNo = '' |
| | | formData.value.TaskStatus = '' |
| | | formData.value.TaskType = '' |
| | | formData.value.ToPlace = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery'); |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | 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 commonQueryEnumForFrom = async () => { |
| | | const taskTypeEnumEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'TaskTypeEnum', |
| | | }) |
| | | updateFormItemOptions('taskType', taskTypeEnumEnum) |
| | | const wmsTaskStatusEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'WmsTaskStatus', |
| | | }) |
| | | updateFormItemOptions('taskStatus', wmsTaskStatusEnum) |
| | | const sonTaskTypeEnumEnum = await wmsTaskDrawer.getWmsEnumData({ |
| | | EnumName: 'SonTaskTypeEnum', |
| | | }) |
| | | updateFormItemOptions('sonTaskType', sonTaskTypeEnumEnum) |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsTask = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsTask', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsTasks = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsTask', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsTask/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsTask = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsTask', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsTask = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsTask/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsTask = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsTask/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsTask = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsTask', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsTask = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsTask/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsTask = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsTask/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsTasks, |
| | | addWmsTask, |
| | | cloneData, |
| | | } from './Service/WmsTask' |
| | | |
| | | export class WmsTask extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsTasks(ids: string[]) { |
| | | return deleteWmsTasks(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsTask(data: Record<string, any>) { |
| | | return addWmsTask(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsTask, |
| | | getWmsTask, |
| | | updateWmsTask, |
| | | getWmsEnumData, |
| | | } from './Service/WmsTaskDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsTaskDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsTask: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsTask(data: Record<string, any>) { |
| | | return addWmsTask(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsTask(id: string, data: Record<string, any>) { |
| | | return updateWmsTask(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsTaskDetail(current: any, id?: string) { |
| | | return getWmsTask(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsTask, |
| | | getWmsTask, |
| | | updateWmsTask, |
| | | getWmsEnumData, |
| | | } from './Service/WmsTaskQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsTaskQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsTask: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsTask(data: Record<string, any>) { |
| | | return addWmsTask(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsTask(id: string, data: Record<string, any>) { |
| | | return updateWmsTask(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsTaskDetail(current: any, id?: string) { |
| | | return getWmsTask(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsTaskDrawer.module.scss' |
| | | import { useWmsTaskDrawer } from '../../../../Controllers/WmsTaskDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirm'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirm, |
| | | onOpen, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsTaskDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'æ·»å '} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onConfirm={onConfirm} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsTaskQueryDrawer.module.scss' |
| | | import { useWmsTaskQueryDrawer } from '../../../../Controllers/WmsTaskQueryDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | //æä¸¾ç±»ååå
¸ |
| | | enumListDict:{ |
| | | type: Array as () => Array<{ key: string; value: object }>, // å®ä¹æ°ç»å
ç´ ç±»å |
| | | default: () => [] // é»è®¤å¼ |
| | | }, |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirmQuery, |
| | | onOpen, |
| | | onReset, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsTaskQueryDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseQueryDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'é«çº§æ¥è¯¢'} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onReset={onReset} |
| | | onConfirmQueryForBase={onConfirmQuery} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'taskNo', |
| | | title: 'ä»»å¡å·', |
| | | }, |
| | | { |
| | | field: 'taskTypeDesc', |
| | | title: 'ä»»å¡ç±»å', |
| | | }, |
| | | { |
| | | field: 'taskStatusDesc', |
| | | title: 'ä»»å¡ç¶æ', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: 'æçç¼å·', |
| | | }, |
| | | { |
| | | field: 'sourcePlace', |
| | | title: 'èµ·å§åºä½', |
| | | }, |
| | | { |
| | | field: 'toPlace', |
| | | title: 'ç®æ åºä½', |
| | | }, |
| | | { |
| | | field: 'aisle', |
| | | title: 'å··é', |
| | | }, |
| | | // { |
| | | // field: 'dodeviceId', |
| | | // title: 'å åæºID', |
| | | // width: 100, |
| | | // }, |
| | | { |
| | | field: 'taskDodeviceStatus', |
| | | title: '设å¤ç¶æ', |
| | | }, |
| | | { |
| | | field: 'isRead', |
| | | title: 'WCSå¯è¯»', |
| | | }, |
| | | { |
| | | field: 'taskLevel', |
| | | title: 'ä¼å
级', |
| | | }, |
| | | { |
| | | field: 'sonTaskTypeDesc', |
| | | title: 'åä»»å¡ç±»å', |
| | | }, |
| | | { |
| | | field: 'sourceOrderNo', |
| | | title: 'æ¥æºåå·', |
| | | }, |
| | | { |
| | | field: 'isNextTask', |
| | | title: 'åç»ä»»å¡', |
| | | }, |
| | | { |
| | | field: 'dodevicetype', |
| | | title: '设å¤ç±»å', |
| | | }, |
| | | |
| | | { |
| | | field: 'creationTime', |
| | | title: 'å建æ¶é´', |
| | | }, |
| | | // { |
| | | // field: 'sort', |
| | | // title: 'æåº', |
| | | // width: 80, |
| | | // }, |
| | | // // 以ä¸ä¸ºæ¬¡è¦ä¿¡æ¯æ¾å¨æå |
| | | // { |
| | | // field: 'mutableParam1', |
| | | // title: 'åé1', |
| | | // width: 100, |
| | | // showOverflow: true, // é¿ææ¬æ¾ç¤ºçç¥å· |
| | | // }, |
| | | // { |
| | | // field: 'mutableParam2', |
| | | // title: 'åé2', |
| | | // width: 100, |
| | | // showOverflow: true, |
| | | // }, |
| | | // { |
| | | // field: 'mutableParam3', |
| | | // title: 'åé3', |
| | | // width: 100, |
| | | // showOverflow: true, |
| | | // }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .wmsTaskContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .wmsTaskList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
| | | .headerContent { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 43px; |
| | | } |
| | | .header { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | } |
| | | } |
| | | |
| | | .tagBox { |
| | | width: auto; |
| | | min-width: 80px; |
| | | height: 24px; |
| | | background: #ffffff; |
| | | border-radius: 19px 19px 19px 19px; |
| | | opacity: 1; |
| | | border: 1px dashed #bcc4cc; |
| | | width: 50px; |
| | | height: 20px; |
| | | font-size: 14px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 400; |
| | | color: #5a84ff; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | // cursor: pointer; |
| | | } |
| | | |
| | | .group { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .groupTable { |
| | | width: 100%; |
| | | } |
| | | |
| | | .overBox { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | overflow: auto; |
| | | :global(.cs-collapse-item__header) { |
| | | background-color: #f1f1f1; |
| | | padding: 0 20px; |
| | | height: 35px; |
| | | font-size: 16px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 500; |
| | | } |
| | | :global(.cs-collapse-item__content) { |
| | | padding-bottom: 0px; |
| | | } |
| | | } |
| | | .groupHeader { |
| | | width: 100%; |
| | | height: 30px; |
| | | background: #ccc; |
| | | } |
| | | |
| | | .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 { computed, defineComponent, onMounted, reactive, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './WmsTask.module.scss' |
| | | import { useWmsTask } from '../../../Controllers/WmsTask' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import WmsTaskDrawer from '../Dialog/WmsTaskDrawer/WmsTaskDrawer' |
| | | import WmsTaskQueryDrawer from '../Dialog/WmsTaskQueryDrawer/WmsTaskQueryDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | | import { vPermission } from '@/libs/Permission/Permission' |
| | | import { |
| | | getWmsEnumData |
| | | } from '@/widgets/WmsTask/Models/Service/WmsTaskDrawer' |
| | | import { |
| | | ElInput, |
| | | ElSelect, |
| | | ElOption, |
| | | ElDatePicker, |
| | | ElForm, |
| | | ElFormItem, |
| | | } from 'element-plus' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | |
| | | interface RenderTableType { |
| | | url?: string |
| | | dataSource: Ref<any[]> |
| | | isDrag?: boolean |
| | | isChecked?: boolean |
| | | isHidePagination?: boolean |
| | | params?: Record<string, any> |
| | | autoHeight?: boolean |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'WmsTask', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | | setup(props, ctx) { |
| | | const { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | headers, |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmWmsTask, |
| | | onCheck, |
| | | onAddWmsTask, |
| | | onAdvancedQuery, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsTask(props, ctx) |
| | | |
| | | //å®ä¹é«çº§æ¥è¯¢å¼ç¨ |
| | | const wmsTaskQueryDrawerRef=ref(null); |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | const queryForm = ref({ |
| | | searchVal: '', |
| | | str_searchFormInputAttrs:[] |
| | | }) |
| | | //å®ä¹æ´ä½æ¨¡ç³æ¥è¯¢çåæ°ç»(注æï¼å¿
须大å°åè·å端çå®ä½ç±»å±æ§åä¸è´ï¼å¦åä¼å¯¼è´å¹é
ä¸å¯¹çé®é¢) |
| | | const _searchFormInputAttrs = ref([ |
| | | 'TaskNo', 'ContainerNo' |
| | | ]); |
| | | const searchFormInputAttrs_Placeholder = ref('请è¾å
¥ä»»å¡ç¼ç /æçç¼ç '); |
| | | |
| | | |
| | | // 卿æä¸¾é项 |
| | | const enumOptions = reactive({ |
| | | taskType: [] as Array<{label: string; value: any }>, |
| | | taskStatus: [] as Array<{label: string; value: any }>, |
| | | sonTaskType: [] as Array<{label: string; value: any }>, |
| | | }) |
| | | |
| | | // è·åæä¸¾æ°æ® |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | const taskTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'TaskTypeEnum', |
| | | }) |
| | | enumOptions.taskType = taskTypeEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | const wmsTaskStatusData = await getWmsEnumData({ |
| | | EnumName: 'WmsTaskStatus', |
| | | }) |
| | | enumOptions.taskStatus = wmsTaskStatusData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | const sonTaskTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'SonTaskTypeEnum', |
| | | }) |
| | | enumOptions.sonTaskType = sonTaskTypeEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | } catch (error) { |
| | | console.error('è·åæä¸¾æ°æ®å¤±è´¥:', error) |
| | | } |
| | | } |
| | | |
| | | // ç»ä»¶æè½½æ¶è·åæä¸¾æ°æ® |
| | | onMounted(() => { |
| | | fetchEnumData() |
| | | }) |
| | | |
| | | // å®ä¹ååºå¼æ¥è¯¢æ°æ® |
| | | const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[] }); |
| | | // æ°ççæ¥è¯¢æ¹æ³ï¼ä¸»é¡µé¢ä¸çæé®ãæ¥è¯¢ãï¼ |
| | | const handleQueryForMain = async () => { |
| | | _curHighQueryData.value.searchVal = queryForm.value.searchVal; |
| | | _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; |
| | | tableRef.value.getList(_curHighQueryData.value) |
| | | } |
| | | // æ°ççæ¥è¯¢æ¹æ³ï¼é«çº§æ¥è¯¢ä¸çæé®ãæ¥è¯¢ãï¼ |
| | | const handleQuery = async (extraParams = {}) => { |
| | | let filteredData = commonGetHighQueryForm(extraParams); |
| | | commonSaveCurHighQueryData(filteredData); |
| | | tableRef.value.getList(filteredData) |
| | | } |
| | | // æ°ççæ¥è¯¢éç½® |
| | | const resetQuery = () => { |
| | | queryForm.value.searchVal = '' |
| | | queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; |
| | | } |
| | | //æ°ççå¯¼åºæ¹æ³ |
| | | const handleExport=()=>{ |
| | | onExport(_curHighQueryData.value); |
| | | } |
| | | // æ°ççæ¥è¯¢å¼¹åºæ¡å
³éæ¹æ³ |
| | | const closeQuery = (extraParams={}) => { |
| | | let filteredData = commonGetHighQueryForm(extraParams); |
| | | console.log("closeQueryæ¹æ³"); |
| | | console.log(filteredData); |
| | | commonSaveCurHighQueryData(filteredData); |
| | | } |
| | | //ä¿åæ¥è¯¢å¼ |
| | | const commonSaveCurHighQueryData=(filteredData={})=>{ |
| | | _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; |
| | | _curHighQueryData.value.searchVal = queryForm.value.searchVal |
| | | _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; |
| | | } |
| | | //è·åé«çº§æ¥è¯¢å¼¹åºæ¡çæ¥è¯¢å¼ |
| | | const commonGetHighQueryForm=(extraParams={})=>{ |
| | | // è¿æ»¤æ undefined çå¼ |
| | | let filteredData = Object.assign( |
| | | {}, |
| | | ...Object.entries(extraParams).map(([key, value]) => |
| | | value !== undefined ? { [key]: value } : {} |
| | | ) |
| | | ) |
| | | //ç»åæ¨¡ç³æ¥è¯¢ |
| | | filteredData.searchVal = queryForm.value.searchVal |
| | | filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; |
| | | return filteredData; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | | */ |
| | | const RenderBaseTable = (props: RenderTableType) => { |
| | | const { |
| | | url, |
| | | dataSource, |
| | | isDrag, |
| | | isChecked, |
| | | isHidePagination, |
| | | params, |
| | | autoHeight, |
| | | } = props |
| | | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.wmsTaskList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/HIAWms/wmsTask/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | | params={params} |
| | | isDrag={isDrag} |
| | | isChecked={isChecked} |
| | | autoHeight={autoHeight} |
| | | onCheck={onCheck} |
| | | onRowClick={onRowClick} |
| | | isHidePagination={isHidePagination} |
| | | pageSize={20} |
| | | v-slots={{ |
| | | name: ({ row }: any) => { |
| | | return row?.name ? ( |
| | | <TdButton |
| | | onClick={() => openDetail(row)} |
| | | text={<span style="color:#5a84ff">详æ
</span>} |
| | | icon="scale" |
| | | tip={row?.name} |
| | | hover |
| | | > |
| | | {row?.name} |
| | | </TdButton> |
| | | ) : ( |
| | | '-' |
| | | ) |
| | | }, |
| | | }} |
| | | ></BaseTable> |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.wmsTaskContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <WmsTaskDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsTask} |
| | | /> |
| | | {/* é«çº§æ¥è¯¢ */} |
| | | <WmsTaskQueryDrawer |
| | | ref="wmsTaskQueryDrawerRef" |
| | | v-model={dialogConfigForQuery.visible} |
| | | title={dialogConfigForQuery.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirmQuery={handleQuery} |
| | | onRestQuery={resetQuery} |
| | | onClose={closeQuery} |
| | | /> |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="wmsTask-add" |
| | | icon="add-p" |
| | | onClick={onAddWmsTask} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="wmsTask-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | | onError={onError} |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/HIAWms/wmsTask/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="wmsTask-output" |
| | | icon="out" |
| | | onClick={handleExport} |
| | | > |
| | | å¯¼åº |
| | | </IconButton> |
| | | </div> |
| | | <ElFormItem style={{ marginTop: '15px' }}> |
| | | <ElFormItem label="å
³é®å"> |
| | | <ElInput |
| | | v-model={queryForm.value.searchVal} |
| | | placeholder={searchFormInputAttrs_Placeholder.value} |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <IconButton type="primary" icon="search" onClick={handleQueryForMain}> |
| | | æ¥è¯¢ |
| | | </IconButton> |
| | | {/* <IconButton style="" icon="refresh" onClick={resetQuery}> |
| | | éç½® |
| | | </IconButton> */} |
| | | <IconButton |
| | | v-permission="wmsTask-add" |
| | | icon="search" |
| | | onClick={onAdvancedQuery} |
| | | type="primary" |
| | | > |
| | | é«çº§æ¥è¯¢ |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </div> |
| | | |
| | | <RenderBaseTable |
| | | url="/api/v1/HIAWms/wmsTask/page" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .WmsTask { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #dbdbdb; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | Component, |
| | | DefineComponent, |
| | | defineComponent, |
| | | markRaw, |
| | | ref, |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './WmsTask.module.scss' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | | import { permissionCodes } from '../enum' |
| | | import { ModuleType, TabItem } from '../type/Type' |
| | | import { getEntityNames } from '@/hooks/hook' |
| | | import TabPane from '@/components/Tab/TabPane' |
| | | |
| | | const Models: ModuleType = import.meta.glob('./config/*.json', { |
| | | eager: true, |
| | | }) |
| | | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | const nameToLabelMap = [{ name: 'WmsTask', label: 'Wmsä»»å¡ç®¡ç' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'WmsTask', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | | usePermission(props, permissionCodes) |
| | | |
| | | const rf = ref<{ |
| | | [key: string]: any |
| | | }>({}) |
| | | |
| | | const tabData = ref<TabItem[]>([]) |
| | | |
| | | const onTabChange = (v: string) => { |
| | | rf.value?.[v]?.reloadList() |
| | | } |
| | | |
| | | const initTableData = async () => { |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const WmsTask = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: WmsTask, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.WmsTask}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['WmsTask'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsTask" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmsTask-list': 'å表-å表', |
| | | 'wmsTask-add': 'å表-æ·»å ', |
| | | 'wmsTask-import': 'å表-导å
¥', |
| | | 'wmsTask-output': 'å表-è¾åº', |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import WmsTask from './Views/WmsTask' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'WmsTask', |
| | | name: 'Wmsä»»å¡ç®¡ç', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(WmsTask), |
| | | settingsView: Setting, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsTaskBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | value?: number |
| | | description?: string |
| | | options?: Array<DataItemType> |
| | | abilityValue?: number | string |
| | | data?: DataItemType |
| | | defaultValue?: string | number |
| | | flow: string |
| | | } |
| | | |
| | | export interface FlowDefinitionType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | } |
| | | |
| | | export type ModuleType = Record< |
| | | string, |
| | | { |
| | | default: Record<string, string> |
| | | name: string |
| | | } |
| | | > |
| | | |
| | | export interface TabItem { |
| | | name: string |
| | | label: string |
| | | component: Component |
| | | hidden?: boolean |
| | | } |
| | |
| | | var str_enumList = this.tb_EnumList.Text.Trim(); |
| | | if (str_enumList.IndexOf(',') > -1) |
| | | { |
| | | str_enumList = str_enumList.Replace("\n",""); |
| | | str_enumList = str_enumList.Replace("\t", ""); |
| | | str_enumList = str_enumList.Replace("\r", ""); |
| | | var arr_enumList = str_enumList.Split(','); |
| | | foreach (var item in arr_enumList) |
| | | { |
| | |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.$ValidateRepeatName$.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | if (impItem.$ValidateRepeatName$.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | $Save_PageAddFormAttributes_Query_Clear$ |
| | | formData.value.materialCode = '' |
| | | formData.value.materialName = '' |
| | | formData.value.purchaseType = '' |
| | | formData.value.materialType = '' |
| | | formData.value.primaryUnit = '' |
| | | formData.value.standard = '' |
| | | formData.value.outerDiameter = '' |
| | | formData.value.wallThickness = '' |
| | | formData.value.materialQuality = '' |
| | | formData.value.length = '' |
| | | formData.value.isMainBranch = '' |
| | | formData.value.factory = '' |
| | | formData.value.certification = '' |
| | | formData.value.remark = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery'); |
| | | } |