¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class GetWmsInOutStockRecordInput : 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 string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum OrderNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§°-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialName_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int? StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum StockType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialModel_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> OperateTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Remark_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SourcePlace_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ToPlace_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> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LastModifierId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool? IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDeleted_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> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDisabled_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Sort_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordCreateDto : WmsInOutStockRecordCreateOrUpdateDtoBase |
| | | { |
| | | /// <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.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsInOutStockRecordCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsInOutStockRecordCreateOrUpdateDtoBase() : 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.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordDto: ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public string StockTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(StockType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ExtraPropertyDictionary? ExtraProperties { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? DeletionTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { 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.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordExportModel |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åæ®ç¼å·", Width = 25)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æåç§°", Width = 25)] |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æä»¶å·", Width = 25)] |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æä½ç±»å", Width = 25)] |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "容å¨ç¼å·", Width = 25)] |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æºå", Width = 25)] |
| | | public string MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æä½æ¶é´", Width = 25)] |
| | | public DateTime OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æID", Width = 25)] |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡å·", Width = 25)] |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "èµ·å§åºä½", Width = 25)] |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç®æ åºä½", Width = 25)] |
| | | public string ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ç¦ç¨", Width = 25)] |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æåº", Width = 25)] |
| | | public int Sort { 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.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordUpdateDto : WmsInOutStockRecordCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord |
| | | { |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordsImportModel |
| | | { |
| | | private List<WmsInOutStockRecordImportModel> _WmsInOutStockRecords = new(); |
| | | |
| | | public List<WmsInOutStockRecordImportModel> WmsInOutStockRecords |
| | | { |
| | | get => _WmsInOutStockRecords; |
| | | set |
| | | { |
| | | _WmsInOutStockRecords = value; |
| | | var rowIndex = 2; |
| | | _WmsInOutStockRecords?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordImportModel : WmsInOutStockRecordExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åå»ºåæ°å¯¹è±¡ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Domain.Entities; |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | using Volo.Abp.Domain.Entities; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | |
| | |  |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial |
| | | { |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åºç¨æå¡æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsInOutStockRecordAppService : ICrudAppService<WmsInOutStockRecordDto, Guid, GetWmsInOutStockRecordInput, WmsInOutStockRecordCreateDto, WmsInOutStockRecordUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsInOutStockRecordDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// å é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsInOutStockRecordsImportModel input); |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsInOutStockRecordInput input); |
| | | } |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | 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.WmsInOutStockRecord; |
| | | 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> |
| | | /// åºå
¥åºè®°å½è¡¨åºç¨æå¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordAppService : CMSPluginAppService, IWmsInOutStockRecordAppService |
| | | { |
| | | private readonly IWmsInOutStockRecordRepository wmsInOutStockRecordRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WmsInOutStockRecordRepository">The task job repository.</param> |
| | | public WmsInOutStockRecordAppService(IWmsInOutStockRecordRepository _WmsInOutStockRecordRepository) |
| | | { |
| | | wmsInOutStockRecordRepository = _WmsInOutStockRecordRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå®åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsInOutStockRecordDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(await wmsInOutStockRecordRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·ååºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<PagedResultDto<WmsInOutStockRecordDto>> GetListAsync(GetWmsInOutStockRecordInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsInOutStockRecord.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await wmsInOutStockRecordRepository.GetCountAsync(whereConditions); |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WmsInOutStockRecordDto>(count, ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> DynamicGetQueryParams(GetWmsInOutStockRecordInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WmsInOutStockRecord, GetWmsInOutStockRecordInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WmsInOutStockRecord, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WmsInOutStockRecord, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsInOutStockRecordDto> CreateAsync(WmsInOutStockRecordCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await wmsInOutStockRecordRepository.NameExistAsync(input.MaterialNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialNo]); |
| | | } |
| | | |
| | | var maxSort = await wmsInOutStockRecordRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WmsInOutStockRecordCreateDto, WmsInOutStockRecord>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await wmsInOutStockRecordRepository.InsertAsync(insertObj); |
| | | |
| | | if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(insertObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsInOutStockRecordDto> UpdateAsync(Guid id, WmsInOutStockRecordUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await wmsInOutStockRecordRepository.GetAsync(id); |
| | | var exist = await wmsInOutStockRecordRepository.NameExistAsync(input.MaterialNo, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialNo]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.OrderNo = input.OrderNo; |
| | | updateObj.MaterialName = input.MaterialName; |
| | | updateObj.MaterialNo = input.MaterialNo; |
| | | updateObj.StockType = input.StockType; |
| | | updateObj.ContainerNo = input.ContainerNo; |
| | | updateObj.MaterialModel = input.MaterialModel; |
| | | updateObj.OperateTime = input.OperateTime; |
| | | updateObj.Remark = input.Remark; |
| | | updateObj.MaterialId = input.MaterialId; |
| | | updateObj.TaskNo = input.TaskNo; |
| | | updateObj.SourcePlace = input.SourcePlace; |
| | | updateObj.ToPlace = input.ToPlace; |
| | | updateObj.IsDisabled = input.IsDisabled; |
| | | |
| | | |
| | | await wmsInOutStockRecordRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(updateObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsInOutStockRecordDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | //var wmsInOutStockRecords = new List<WmsInOutStockRecord>(); |
| | | //if (ids != null) |
| | | //{ |
| | | // var sort = await wmsInOutStockRecordRepository.GetMaxSortAsync(); |
| | | // foreach (var id in ids) |
| | | // { |
| | | // var WmsInOutStockRecord = await wmsInOutStockRecordRepository.FindAsync(id); |
| | | // if (WmsInOutStockRecord != null) |
| | | // { |
| | | // var name = WmsInOutStockRecord.Name + WmsInOutStockRecordConsts.CloneTag; |
| | | // var notExist = false; |
| | | // while (!notExist) |
| | | // { |
| | | // var exist = await wmsInOutStockRecordRepository.NameExistAsync(name); |
| | | // if (exist || wmsInOutStockRecords.Any(x => x.Name == name)) |
| | | // { |
| | | // name += WmsInOutStockRecordConsts.CloneTag; |
| | | // continue; |
| | | // } |
| | | |
| | | // notExist = true; |
| | | // } |
| | | |
| | | // //WmsInOutStockRecord = await wmsInOutStockRecordRepository.InsertAsync(WmsInOutStockRecord.Clone(GuidGenerator.Create(), name, sort++)); |
| | | // wmsInOutStockRecords.Add(WmsInOutStockRecord); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //return ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(wmsInOutStockRecords); |
| | | return new List<WmsInOutStockRecordDto>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å个åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return wmsInOutStockRecordRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å¤ä¸ªåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(null, nameof(WmsInOutStockRecord.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 wmsInOutStockRecordRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WmsInOutStockRecordsImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsInOutStockRecordCreateDtos = new List<(int RowIndex, WmsInOutStockRecordCreateDto Item)>(); |
| | | var wmsInOutStockRecordUpdateDtos = new List<(int RowIndex, Guid Id, WmsInOutStockRecordUpdateDto Item)>(); |
| | | var importItems = input.WmsInOutStockRecords; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsInOutStockRecords = importItems.GroupBy(x => x.MaterialNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsInOutStockRecords?.Any() == true) |
| | | { |
| | | var duplicateWmsInOutStockRecordMsgs = duplicateWmsInOutStockRecords.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsInOutStockRecordMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.MaterialNo.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.MaterialNo.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WmsInOutStockRecordåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsInOutStockRecord = await wmsInOutStockRecordRepository.FindByNameAsync(impItem.MaterialNo); |
| | | if (oldWmsInOutStockRecord != null) |
| | | { |
| | | var wmsInOutStockRecordUpdateDto = new WmsInOutStockRecordUpdateDto |
| | | { |
| | | OrderNo = impItem.OrderNo, |
| | | MaterialName = impItem.MaterialName, |
| | | MaterialNo = impItem.MaterialNo, |
| | | StockType = impItem.StockType, |
| | | ContainerNo = impItem.ContainerNo, |
| | | MaterialModel = impItem.MaterialModel, |
| | | OperateTime = impItem.OperateTime, |
| | | Remark = impItem.Remark, |
| | | MaterialId = impItem.MaterialId, |
| | | TaskNo = impItem.TaskNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | ToPlace = impItem.ToPlace, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | wmsInOutStockRecordUpdateDtos.Add((impItem.RowIndex, oldWmsInOutStockRecord.Id, wmsInOutStockRecordUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsInOutStockRecordCreateDto = new WmsInOutStockRecordCreateDto |
| | | { |
| | | OrderNo = impItem.OrderNo, |
| | | MaterialName = impItem.MaterialName, |
| | | MaterialNo = impItem.MaterialNo, |
| | | StockType = impItem.StockType, |
| | | ContainerNo = impItem.ContainerNo, |
| | | MaterialModel = impItem.MaterialModel, |
| | | OperateTime = impItem.OperateTime, |
| | | Remark = impItem.Remark, |
| | | MaterialId = impItem.MaterialId, |
| | | TaskNo = impItem.TaskNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | ToPlace = impItem.ToPlace, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | wmsInOutStockRecordCreateDtos.Add((impItem.RowIndex, wmsInOutStockRecordCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsInOutStockRecordDto in wmsInOutStockRecordCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsInOutStockRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsInOutStockRecordDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsInOutStockRecordDto in wmsInOutStockRecordUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsInOutStockRecordDto.Id, wmsInOutStockRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsInOutStockRecordDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsInOutStockRecordInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsInOutStockRecord.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "åºå
¥åºè®°å½è¡¨å表" : result.Count == 1 ? result[0]?.MaterialNo : "WmsInOutStockRecord模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªåºå
¥åºè®°å½è¡¨ï¼å½æ°å»ºææ´æ°æ¶ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsInOutStockRecordCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.OrderNo, "åæ®ç¼å·", 50); |
| | | Check.NotNullOrWhiteSpace(input.MaterialNo, "ç©æä»¶å·", 50); |
| | | Check.NotNull(input.StockType, "æä½ç±»å"); |
| | | Check.NotNullOrWhiteSpace(input.MaterialId, "ç©æID", 50); |
| | | Check.NotNullOrWhiteSpace(input.TaskNo, "ä»»å¡å·", 50); |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsInOutStockRecordAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsInOutStockRecordAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsInOutStockRecord, WmsInOutStockRecordDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsInOutStockRecordCreateDto, WmsInOutStockRecord>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsInOutStockRecordInput, WmsInOutStockRecord>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | [Description("åä»»å¡ç±»å")] |
| | | public enum SonTaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// èªå¨å
¥åº |
| | | /// </summary> |
| | | [Description("èªå¨å
¥åº")] |
| | | ZDRUKU = 1, |
| | | |
| | | /// <summary> |
| | | /// 人工å
¥åº |
| | | /// </summary> |
| | | [Description("人工å
¥åº")] |
| | | RGRUKU = 2, |
| | | |
| | | /// <summary> |
| | | /// 人工åºåº |
| | | /// </summary> |
| | | [Description("人工åºåº")] |
| | | RGCHUKU = 3, |
| | | /// <summary> |
| | | /// èªå¨åºåº |
| | | /// </summary> |
| | | [Description("èªå¨åºåº")] |
| | | ZDCHUKU = 4, |
| | | |
| | | /// <summary> |
| | | /// 空æå¼å« |
| | | /// </summary> |
| | | [Description("空æå¼å«")] |
| | | KTHUJIOA = 5, |
| | | |
| | | /// <summary> |
| | | /// ååº |
| | | /// </summary> |
| | | [Description("ååº")] |
| | | HUIKU = 6, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åºåç±»å |
| | | /// </summary> |
| | | [Description("åºåç±»å")] |
| | | public enum StockTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | InBound = 1, |
| | | |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | OutBound = 2, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | [Description("ä»»å¡ç±»å")] |
| | | public enum TaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | CHUKU = 1, |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | RUKU = 2, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [Description("ä»»å¡ç¶æ")] |
| | | public enum WmsTaskStatus |
| | | { |
| | | /// <summary> |
| | | /// æªæ§è¡ |
| | | /// </summary> |
| | | [Description("æªæ§è¡")] |
| | | WEIZHIXING = 1, |
| | | /// <summary> |
| | | /// å¾
æ§è¡ |
| | | /// </summary> |
| | | [Description("å¾
æ§è¡")] |
| | | DAIZHIXINGZHONG = 2, |
| | | /// <summary> |
| | | /// æ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("æ§è¡ä¸")] |
| | | ZHIXINGZHONG = 3, |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("宿")] |
| | | WANCHENG = 4, |
| | | /// <summary> |
| | | /// åæ¶ |
| | | /// </summary> |
| | | [Description("åæ¶")] |
| | | QUXIAO = 5 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨ä»å¨ |
| | | /// </summary> |
| | | public interface IWmsInOutStockRecordRepository : IBasicRepository<WmsInOutStockRecord, Guid> |
| | | { |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<WmsInOutStockRecord> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// è·åå页å表åºå
¥åºè®°å½è¡¨ |
| | | /// </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<WmsInOutStockRecord>> GetListAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord |
| | | { |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½. |
| | | /// </summary> |
| | | public class WmsInOutStockRecord : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å·. |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå· |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | } |
| | | } |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using NPOI.SS.Formula.Functions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsTask |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ |
| | | /// </summary>W |
| | | public class WmsTask : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public WmsTaskStatus TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | public int Dodevicetype { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | public bool IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public SonTaskTypeEnum? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | public string? SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å
³èçä¸ä¸ªä»»å¡æ¯å¦çææåï¼å¤±è´¥ä¸º1ï¼å
¶ä»æ æä½ |
| | | /// </summary> |
| | | public int? IsNextTask { 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 virtual int Sort { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions |
| | | { |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsInOutStockRecord> IncludeDetails(this IQueryable<WmsInOutStockRecord> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsmaterial. |
| | | /// </summary> |
| | | /// <param name="builder"></param> |
| | | public static void ConfigureWmsInOutStockRecord(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsInOutStockRecord>(b => |
| | | { |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsInOutStockRecords").ToLower(), CMSPluginDbProperties.DbSchema) |
| | | .HasComment("åºå
¥åºè®°å½è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | // 主é®é
ç½® |
| | | b.HasKey(x => x.Id); |
| | | // Properties |
| | | b.Property(x => x.OrderNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("åæ®ç¼å·"); |
| | | |
| | | b.Property(x => x.MaterialName) |
| | | .HasMaxLength(100) |
| | | .IsRequired(false) |
| | | .HasComment("ç©æåç§°"); |
| | | |
| | | b.Property(x => x.MaterialNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ç©æä»¶å·"); |
| | | |
| | | b.Property(x => x.StockType) |
| | | .IsRequired() |
| | | .HasComment("æä½ç±»å"); |
| | | |
| | | b.Property(x => x.ContainerNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("容å¨ç¼å·"); |
| | | |
| | | b.Property(x => x.MaterialModel) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æºå"); |
| | | |
| | | b.Property(x => x.OperateTime) |
| | | .IsRequired(false) |
| | | .HasComment("æä½æ¶é´"); |
| | | |
| | | b.Property(x => x.Remark) |
| | | .HasMaxLength(500) |
| | | .IsRequired(false) |
| | | .HasComment("夿³¨"); |
| | | |
| | | b.Property(x => x.MaterialId) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ç©æID"); |
| | | |
| | | b.Property(x => x.TaskNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡å·"); |
| | | |
| | | b.Property(x => x.SourcePlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("èµ·å§åºä½"); |
| | | |
| | | b.Property(x => x.ToPlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("ç®æ åºä½"); |
| | | |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(x => x.OrderNo); |
| | | b.HasIndex(x => x.MaterialNo); |
| | | b.HasIndex(x => x.MaterialId); |
| | | b.HasIndex(x => x.TaskNo); |
| | | b.HasIndex(x => x.StockType); |
| | | b.HasIndex(x => x.ContainerNo); |
| | | b.HasIndex(x => x.OperateTime); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions |
| | | { |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsTask> IncludeDetails(this IQueryable<WmsTask> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | /// <summary> |
| | | /// Configures the WMS task entity. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsTask(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsTask>(b => |
| | | { |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsTasks").ToLower(), CMSPluginDbProperties.DbSchema) |
| | | .HasComment("ä»»å¡è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Primary key configuration (inherited from FullAuditedAggregateRoot<Guid>) |
| | | b.HasKey(x => x.Id); |
| | | |
| | | // Properties configuration |
| | | b.Property(x => x.TaskNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡å·"); |
| | | |
| | | b.Property(x => x.TaskType) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç±»å"); |
| | | |
| | | b.Property(x => x.TaskLevel) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç级"); |
| | | |
| | | b.Property(x => x.TaskStatus) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç¶æ"); |
| | | |
| | | b.Property(x => x.ContainerNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æçç¼å·"); |
| | | |
| | | b.Property(x => x.SourcePlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("èµ·å§åºä½"); |
| | | |
| | | b.Property(x => x.ToPlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("ç®æ åºä½"); |
| | | |
| | | b.Property(x => x.Aisle) |
| | | .IsRequired(false) |
| | | .HasComment("å··é"); |
| | | |
| | | b.Property(x => x.DodeviceId) |
| | | .IsRequired(false) |
| | | .HasComment("å åæºID"); |
| | | |
| | | b.Property(x => x.Dodevicetype) |
| | | .IsRequired() |
| | | .HasComment("设å¤ç±»å"); |
| | | |
| | | b.Property(x => x.TaskDodeviceStatus) |
| | | .IsRequired() |
| | | .HasComment("设å¤ä»»å¡ç¶æ"); |
| | | |
| | | b.Property(x => x.IsRead) |
| | | .IsRequired() |
| | | .HasComment("WCSæ¯å¦å¯ä»¥è¯»å"); |
| | | |
| | | b.Property(x => x.SonTaskType) |
| | | .IsRequired(false) |
| | | .HasComment("åä»»å¡ç±»å"); |
| | | |
| | | b.Property(x => x.SourceOrderNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æ¥æºåæ®å·"); |
| | | |
| | | b.Property(x => x.IsNextTask) |
| | | .IsRequired(false) |
| | | .HasComment("ä¸ä¸ªä»»å¡æ¯å¦çææå"); |
| | | |
| | | b.Property(x => x.MutableParam1) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé1"); |
| | | |
| | | b.Property(x => x.MutableParam2) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé2"); |
| | | |
| | | b.Property(x => x.MutableParam3) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé3"); |
| | | |
| | | b.Property(x => x.Sort) |
| | | .IsRequired() |
| | | .HasComment("æåº"); |
| | | |
| | | b.Property(x => x.IsDisabled) |
| | | .IsRequired(false) |
| | | .HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes configuration |
| | | b.HasIndex(x => x.TaskNo).IsUnique(); |
| | | b.HasIndex(x => x.TaskType); |
| | | b.HasIndex(x => x.TaskStatus); |
| | | b.HasIndex(x => x.ContainerNo); |
| | | b.HasIndex(x => x.SourcePlace); |
| | | b.HasIndex(x => x.ToPlace); |
| | | b.HasIndex(x => x.DodeviceId); |
| | | b.HasIndex(x => x.IsRead); |
| | | b.HasIndex(x => x.SourceOrderNo); |
| | | b.HasIndex(x => x.Sort); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | 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> |
| | | /// åºå
¥åºè®°å½è¡¨ä»å¨å®ç° |
| | | /// </summary> |
| | | public class EfCoreWmsInOutStockRecordRepository : EfCoreRepository<ICMSPluginDbContext, WmsInOutStockRecord, Guid>, IWmsInOutStockRecordRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsInOutStockRecordRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsInOutStockRecordRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsInOutStockRecord> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.MaterialNo == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨åºå
¥åºè®°å½è¡¨ |
| | | /// </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.MaterialNo == name); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </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> |
| | | /// è·åå页å表åºå
¥åºè®°å½è¡¨ |
| | | /// </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<WmsInOutStockRecord>> GetListAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, 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(WmsInOutStockRecord.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, 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<WmsInOutStockRecord>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using Microsoft.EntityFrameworkCore; |
| | |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsMaterial(); |
| | | builder.ConfigureWmsInOutStockRecord(); |
| | | builder.ConfigureWmsTask(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | 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> |
| | | /// åºå
¥åºè®°å½è¡¨æå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsInOutStockRecordController : ControllerBase |
| | | { |
| | | private readonly IWmsInOutStockRecordAppService _wmsInOutStockRecordAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsInOutStockRecordAppService">The wmsInOutStockRecord application service.</param> |
| | | public WmsInOutStockRecordController(IWmsInOutStockRecordAppService wmsInOutStockRecordAppService) |
| | | { |
| | | _wmsInOutStockRecordAppService = wmsInOutStockRecordAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·ååºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsInOutStockRecordDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsInOutStockRecordAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·ååºå
¥åºè®°å½è¡¨çå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | | public virtual Task<PagedResultDto<WmsInOutStockRecordDto>> GetListAsync([FromQuery] GetWmsInOutStockRecordInput input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsInOutStockRecordDto> CreateAsync(WmsInOutStockRecordCreateDto input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsInOutStockRecordDto> UpdateAsync(Guid id, WmsInOutStockRecordUpdateDto input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsInOutStockRecordDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsInOutStockRecordAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsInOutStockRecordAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsInOutStockRecordAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsInOutStockRecordAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </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 wmsInOutStockRecordRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsInOutStockRecordsImportModel.WmsInOutStockRecordImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsInOutStockRecordRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsInOutStockRecordAppService.ImportAsync(new WmsInOutStockRecordsImportModel |
| | | { |
| | | WmsInOutStockRecords = wmsInOutStockRecordRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsInOutStockRecordInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsInOutStockRecordAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsInOutStockRecordå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsInOutStockRecordå¯¼åºæ¨¡æ¿.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" }; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Ao.Lang; |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "åºå
¥åºè®°å½", |
| | | "path": "/information-base/WmsInOutStockRecord", |
| | | "patchName": "WmsInOutStockRecord", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "Wmsæç管ç", |
| | | "path": "/information-base/WmsContainer", |
| | | "patchName": "WmsContainer", |
| | |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "Wmsç©æåºç¡", |
| | | "name": "ç©æä¿¡æ¯", |
| | | "path": "/information-base/HIAWms", |
| | | "patchName": "HIAWms", |
| | | "icon": "p", |
| | |
| | | "name": "ä»åºä¿¡æ¯", |
| | | "path": "/information-base/WmsStoreInfo", |
| | | "patchName": "WmsStoreInfo", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "WmsInOutStockRecord": { |
| | | "name": "åºå
¥åºè®°å½", |
| | | "path": "/information-base/WmsInOutStockRecord", |
| | | "patchName": "WmsInOutStockRecord", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | |
| | | "notPage": false |
| | | }, |
| | | "HIAWms": { |
| | | "name": "Wmsç©æåºç¡", |
| | | "name": "ç©æä¿¡æ¯", |
| | | "path": "/information-base/HIAWms", |
| | | "patchName": "HIAWms", |
| | | "icon": "p", |
| | |
| | | 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 { 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 { WmsMaterial } from '../Models/WmsMaterial' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsMaterial = (props: any, ctx?: any) => { |
| | | const wmsMaterial = injectModel<WmsMaterial>('wmsMaterial') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsMaterialColumns = 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 wmsMaterial.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { name: string }) => item.name) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await wmsMaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsMaterial = () => { |
| | | 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 = 'é«çº§æ¥è¯¢' |
| | | } |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterial } from '../Models/WmsMaterial' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | const onConfirmWmsMaterial = 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/wmsMaterial/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, |
| | | wmsMaterialColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddWmsMaterial, |
| | | onAdvancedQuery |
| | | } |
| | | } |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsMaterial = (props: any, ctx?: any) => { |
| | | const wmsMaterial = injectModel<WmsMaterial>('wmsMaterial') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsMaterialColumns = 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 wmsMaterial.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { name: string }) => item.name) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await wmsMaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsMaterial = () => { |
| | | 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 onConfirmWmsMaterial = 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/wmsMaterial/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, |
| | | wmsMaterialColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddWmsMaterial, |
| | | onAdvancedQuery |
| | | } |
| | | } |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialDrawer = injectModel<WmsMaterialDrawer>('wmsMaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'materialCode', |
| | | el: 'input', |
| | | disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç¼ç ', |
| | | rules: [{ required: true, message: 'ç©æç¼ç ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | rules: [{ required: true, message: 'ç©æåç§°ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'éè´ç±»å', |
| | | prop: 'purchaseType', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©éè´ç±»å', |
| | | options: [], |
| | | rules: [{ required: true, message: 'è¯·éæ©éè´ç±»å', trigger: 'change' }], |
| | | }, |
| | | { |
| | | label: 'ç©æç±»å', |
| | | prop: 'materialType', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©ç©æç±»å', |
| | | options: [], |
| | | rules: [{ required: true, message: 'è¯·éæ©ç©æç±»å', trigger: 'change' }], |
| | | }, |
| | | { |
| | | label: '主åä½', |
| | | prop: 'primaryUnit', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ä¸»åä½(å¦: kg, m, 个)', |
| | | }, |
| | | { |
| | | label: 'è§æ ¼/æ å', |
| | | prop: 'standard', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥è§æ ¼/æ å(å¦: GB/T 8163-2018)', |
| | | }, |
| | | { |
| | | label: 'å¤å¾(mm)', |
| | | prop: 'outerDiameter', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥å¤å¾', |
| | | step: 0.01, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'å£å(mm)', |
| | | prop: 'wallThickness', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥å£å', |
| | | step: 0.01, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'æè´¨', |
| | | prop: 'materialQuality', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥æè´¨(å¦: 304ä¸éé¢)', |
| | | }, |
| | | { |
| | | label: 'é¿åº¦(m)', |
| | | prop: 'length', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥é¿åº¦', |
| | | step: 0.1, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ä¸»æ¯ç®¡', |
| | | prop: 'isMainBranch', |
| | | el: 'select', |
| | | options: [], |
| | | }, |
| | | { |
| | | label: 'ç产工å', |
| | | prop: 'factory', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ç产工å', |
| | | }, |
| | | { |
| | | label: 'è¯ä¹¦ç¼å·', |
| | | prop: 'certification', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | type: 'textarea', |
| | | 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 = { |
| | | materialCode: formData.value.materialCode, |
| | | materialName: formData.value.materialName, |
| | | purchaseType: formData.value.purchaseType, |
| | | materialType: formData.value.materialType, |
| | | primaryUnit: formData.value.primaryUnit, |
| | | standard: formData.value.standard, |
| | | outerDiameter: formData.value.outerDiameter, |
| | | wallThickness: formData.value.wallThickness, |
| | | materialQuality: formData.value.materialQuality, |
| | | length: formData.value.length, |
| | | isMainBranch: formData.value.isMainBranch, |
| | | factory: formData.value.factory, |
| | | certification: formData.value.certification, |
| | | remark: formData.value.remark, |
| | | } |
| | | if (!current.value) { |
| | | await wmsMaterialDrawer.addWmsMaterial(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsMaterialDrawer.updateWmsMaterial(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 materialTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | updateFormItemOptions('materialType', materialTypeEnum) |
| | | |
| | | const purchaseTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | updateFormItemOptions('purchaseType', purchaseTypeEnum) |
| | | |
| | | const yesOrNoTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | updateFormItemOptions('isMainBranch', yesOrNoTypeEnum) |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await wmsMaterialDrawer.getWmsMaterialDetail(current.value) |
| | | |
| | | formData.value = { |
| | | materialCode: res.materialCode, |
| | | materialName: res.materialName, |
| | | purchaseType: res.purchaseType, |
| | | materialType: res.materialType, |
| | | primaryUnit: res.primaryUnit, |
| | | standard: res.standard, |
| | | outerDiameter: res.outerDiameter, |
| | | wallThickness: res.wallThickness, |
| | | materialQuality: res.materialQuality, |
| | | length: res.length, |
| | | isMainBranch: res.isMainBranch, |
| | | factory: res.factory, |
| | | certification: res.certification, |
| | | remark: res.remark, |
| | | 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 { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialDrawer = injectModel<WmsMaterialDrawer>('wmsMaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'materialCode', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç¼ç ï¼å¯ä¸æ è¯ï¼', |
| | | rules: [{required: true, message: 'ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | rules: [{required: true, message: 'ç©æåç§°ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'éè´ç±»åï¼æä¸¾å¼ï¼', |
| | | prop: 'purchaseType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥éè´ç±»åï¼æä¸¾å¼ï¼', |
| | | rules: [{required: true, message: 'éè´ç±»åï¼æä¸¾å¼ï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æç±»åï¼æä¸¾å¼ï¼', |
| | | prop: 'materialType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç±»åï¼æä¸¾å¼ï¼', |
| | | rules: [{required: true, message: 'ç©æç±»åï¼æä¸¾å¼ï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '主åä½ï¼å¦ï¼kgãmã个ï¼', |
| | | prop: 'primaryUnit', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¸»åä½ï¼å¦ï¼kgãmã个ï¼', |
| | | }, |
| | | { |
| | | label: 'è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼', |
| | | prop: 'standard', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼', |
| | | }, |
| | | { |
| | | label: 'å¤å¾ï¼åä½ï¼mmï¼', |
| | | prop: 'outerDiameter', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤å¾ï¼åä½ï¼mmï¼', |
| | | rules: [{required: true, message: 'å¤å¾ï¼åä½ï¼mmï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'å£åï¼åä½ï¼mmï¼', |
| | | prop: 'wallThickness', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å£åï¼åä½ï¼mmï¼', |
| | | rules: [{required: true, message: 'å£åï¼åä½ï¼mmï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'æè´¨ï¼å¦ï¼304ä¸éé¢ï¼', |
| | | prop: 'materialQuality', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æè´¨ï¼å¦ï¼304ä¸éé¢ï¼', |
| | | }, |
| | | { |
| | | label: 'é¿åº¦ï¼åä½ï¼mï¼', |
| | | prop: 'length', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥é¿åº¦ï¼åä½ï¼mï¼', |
| | | rules: [{required: true, message: 'é¿åº¦ï¼åä½ï¼mï¼ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ä¸ºä¸»æ¯ç®¡', |
| | | prop: 'isMainBranch', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æ¯å¦ä¸ºä¸»æ¯ç®¡', |
| | | rules: [{required: true, message: 'æ¯å¦ä¸ºä¸»æ¯ç®¡ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç产工å', |
| | | prop: 'factory', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç产工å', |
| | | }, |
| | | { |
| | | label: 'è¯ä¹¦ç¼å·', |
| | | prop: 'certification', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | label: 'åä½å段1 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField1', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段1 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: 'åä½å段2 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField2', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段2 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: 'åä½å段3 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField3', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段3 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ç¦ç¨', |
| | | prop: 'isDisabled', |
| | | el: 'select', |
| | | //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 = { |
| | | materialCode: formData.value.materialCode, |
| | | materialName: formData.value.materialName, |
| | | purchaseType: formData.value.purchaseType, |
| | | materialType: formData.value.materialType, |
| | | primaryUnit: formData.value.primaryUnit, |
| | | standard: formData.value.standard, |
| | | outerDiameter: formData.value.outerDiameter, |
| | | wallThickness: formData.value.wallThickness, |
| | | materialQuality: formData.value.materialQuality, |
| | | length: formData.value.length, |
| | | isMainBranch: formData.value.isMainBranch, |
| | | factory: formData.value.factory, |
| | | certification: formData.value.certification, |
| | | redundantField1: formData.value.redundantField1, |
| | | redundantField2: formData.value.redundantField2, |
| | | redundantField3: formData.value.redundantField3, |
| | | remark: formData.value.remark, |
| | | isDisabled: formData.value.isDisabled, |
| | | } |
| | | if (!current.value) { |
| | | await wmsMaterialDrawer.addWmsMaterial(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsMaterialDrawer.updateWmsMaterial(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 purchaseTypeEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | updateFormItemOptions('purchaseType', purchaseTypeEnumEnum) |
| | | const materialTypeEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | updateFormItemOptions('materialType', materialTypeEnumEnum) |
| | | const yesNoEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | updateFormItemOptions('isMainBranch', yesNoEnumEnum) |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await wmsMaterialDrawer.getWmsMaterialDetail(current.value) |
| | | |
| | | formData.value = { |
| | | materialCode: res.materialCode, |
| | | materialName: res.materialName, |
| | | purchaseType: res.purchaseType, |
| | | materialType: res.materialType, |
| | | primaryUnit: res.primaryUnit, |
| | | standard: res.standard, |
| | | outerDiameter: res.outerDiameter, |
| | | wallThickness: res.wallThickness, |
| | | materialQuality: res.materialQuality, |
| | | length: res.length, |
| | | isMainBranch: res.isMainBranch, |
| | | factory: res.factory, |
| | | certification: res.certification, |
| | | redundantField1: res.redundantField1, |
| | | redundantField2: res.redundantField2, |
| | | redundantField3: res.redundantField3, |
| | | remark: res.remark, |
| | | isDisabled: res.isDisabled, |
| | | 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 { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialDrawer = injectModel<WmsMaterialDrawer>('WmsMaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'materialCode', |
| | | el: 'input', |
| | | disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç¼ç ', |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | }, |
| | | { |
| | | label: 'éè´ç±»å', |
| | | prop: 'purchaseType', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©éè´ç±»å', |
| | | options: [], |
| | | }, |
| | | { |
| | | label: 'ç©æç±»å', |
| | | prop: 'materialType', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©ç©æç±»å', |
| | | options: [], |
| | | }, |
| | | { |
| | | label: '主åä½', |
| | | prop: 'primaryUnit', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ä¸»åä½(å¦: kg, m, 个)', |
| | | }, |
| | | { |
| | | label: 'è§æ ¼/æ å', |
| | | prop: 'standard', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥è§æ ¼/æ å(å¦: GB/T 8163-2018)', |
| | | }, |
| | | { |
| | | label: 'å¤å¾(mm)', |
| | | prop: 'outerDiameter', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥å¤å¾', |
| | | step: 0.01, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'å£å(mm)', |
| | | prop: 'wallThickness', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥å£å', |
| | | step: 0.01, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'æè´¨', |
| | | prop: 'materialQuality', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥æè´¨(å¦: 304ä¸éé¢)', |
| | | }, |
| | | { |
| | | label: 'é¿åº¦(m)', |
| | | prop: 'length', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | placeholder: '请è¾å
¥é¿åº¦', |
| | | step: 0.1, |
| | | precision: 2, |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ä¸»æ¯ç®¡', |
| | | prop: 'isMainBranch', |
| | | el: 'select', |
| | | options: [], |
| | | }, |
| | | { |
| | | label: 'ç产工å', |
| | | prop: 'factory', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥ç产工å', |
| | | }, |
| | | { |
| | | label: 'è¯ä¹¦ç¼å·', |
| | | prop: 'certification', |
| | | el: 'input', |
| | | placeholder: '请è¾å
¥è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | type: 'textarea', |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData=()=>{ |
| | | const data = { |
| | | materialCode: formData.value.materialCode, |
| | | materialName: formData.value.materialName, |
| | | purchaseType: formData.value.purchaseType, |
| | | materialType: formData.value.materialType, |
| | | primaryUnit: formData.value.primaryUnit, |
| | | standard: formData.value.standard, |
| | | outerDiameter: formData.value.outerDiameter, |
| | | wallThickness: formData.value.wallThickness, |
| | | materialQuality: formData.value.materialQuality, |
| | | length: formData.value.length, |
| | | isMainBranch: formData.value.isMainBranch, |
| | | factory: formData.value.factory, |
| | | certification: formData.value.certification, |
| | | remark: formData.value.remark, |
| | | } |
| | | 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.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'); |
| | | } |
| | | |
| | | 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 materialTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | updateFormItemOptions('materialType', materialTypeEnum) |
| | | |
| | | const purchaseTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | updateFormItemOptions('purchaseType', purchaseTypeEnum) |
| | | |
| | | const yesOrNoTypeEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | updateFormItemOptions('isMainBranch', yesOrNoTypeEnum) |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialDrawer = injectModel<WmsMaterialDrawer>('WmsMaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'materialCode', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç¼ç ï¼å¯ä¸æ è¯ï¼', |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | }, |
| | | { |
| | | label: 'éè´ç±»åï¼æä¸¾å¼ï¼', |
| | | prop: 'purchaseType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥éè´ç±»åï¼æä¸¾å¼ï¼', |
| | | }, |
| | | { |
| | | label: 'ç©æç±»åï¼æä¸¾å¼ï¼', |
| | | prop: 'materialType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æç±»åï¼æä¸¾å¼ï¼', |
| | | }, |
| | | { |
| | | label: '主åä½ï¼å¦ï¼kgãmã个ï¼', |
| | | prop: 'primaryUnit', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¸»åä½ï¼å¦ï¼kgãmã个ï¼', |
| | | }, |
| | | { |
| | | label: 'è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼', |
| | | prop: 'standard', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼', |
| | | }, |
| | | { |
| | | label: 'å¤å¾ï¼åä½ï¼mmï¼', |
| | | prop: 'outerDiameter', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤å¾ï¼åä½ï¼mmï¼', |
| | | }, |
| | | { |
| | | label: 'å£åï¼åä½ï¼mmï¼', |
| | | prop: 'wallThickness', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å£åï¼åä½ï¼mmï¼', |
| | | }, |
| | | { |
| | | label: 'æè´¨ï¼å¦ï¼304ä¸éé¢ï¼', |
| | | prop: 'materialQuality', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æè´¨ï¼å¦ï¼304ä¸éé¢ï¼', |
| | | }, |
| | | { |
| | | label: 'é¿åº¦ï¼åä½ï¼mï¼', |
| | | prop: 'length', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥é¿åº¦ï¼åä½ï¼mï¼', |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ä¸ºä¸»æ¯ç®¡', |
| | | prop: 'isMainBranch', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æ¯å¦ä¸ºä¸»æ¯ç®¡', |
| | | }, |
| | | { |
| | | label: 'ç产工å', |
| | | prop: 'factory', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç产工å', |
| | | }, |
| | | { |
| | | label: 'è¯ä¹¦ç¼å·', |
| | | prop: 'certification', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | label: 'åä½å段1 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField1', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段1 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: 'åä½å段2 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField2', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段2 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: 'åä½å段3 - é¢çæ©å±ç¨é', |
| | | prop: 'redundantField3', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åä½å段3 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | }, |
| | | { |
| | | label: 'æ¯å¦ç¦ç¨', |
| | | prop: 'isDisabled', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æ¯å¦ç¦ç¨', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData=()=>{ |
| | | const data = { |
| | | MaterialCode: formData.value.MaterialCode, |
| | | MaterialName: formData.value.MaterialName, |
| | | PurchaseType: formData.value.PurchaseType, |
| | | MaterialType: formData.value.MaterialType, |
| | | PrimaryUnit: formData.value.PrimaryUnit, |
| | | Standard: formData.value.Standard, |
| | | OuterDiameter: formData.value.OuterDiameter, |
| | | WallThickness: formData.value.WallThickness, |
| | | MaterialQuality: formData.value.MaterialQuality, |
| | | Length: formData.value.Length, |
| | | IsMainBranch: formData.value.IsMainBranch, |
| | | Factory: formData.value.Factory, |
| | | Certification: formData.value.Certification, |
| | | RedundantField1: formData.value.RedundantField1, |
| | | RedundantField2: formData.value.RedundantField2, |
| | | RedundantField3: formData.value.RedundantField3, |
| | | Remark: formData.value.Remark, |
| | | IsDisabled: formData.value.IsDisabled, |
| | | materialCode: formData.value.materialCode, |
| | | materialName: formData.value.materialName, |
| | | purchaseType: formData.value.purchaseType, |
| | | materialType: formData.value.materialType, |
| | | primaryUnit: formData.value.primaryUnit, |
| | | standard: formData.value.standard, |
| | | outerDiameter: formData.value.outerDiameter, |
| | | wallThickness: formData.value.wallThickness, |
| | | materialQuality: formData.value.materialQuality, |
| | | length: formData.value.length, |
| | | isMainBranch: formData.value.isMainBranch, |
| | | factory: formData.value.factory, |
| | | certification: formData.value.certification, |
| | | remark: formData.value.remark, |
| | | } |
| | | 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.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.RedundantField1 = '' |
| | | formData.value.RedundantField2 = '' |
| | | formData.value.RedundantField3 = '' |
| | | formData.value.Remark = '' |
| | | formData.value.IsDisabled = '' |
| | | 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'); |
| | | } |
| | | |
| | | 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 purchaseTypeEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | updateFormItemOptions('purchaseType', purchaseTypeEnumEnum) |
| | | const materialTypeEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | updateFormItemOptions('materialType', materialTypeEnumEnum) |
| | | const yesNoEnumEnum = await wmsMaterialDrawer.getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | updateFormItemOptions('isMainBranch', yesNoEnumEnum) |
| | | |
| | | } |
| | | 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 addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterials = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hIAWms/wmsMaterial', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsMaterial/clone', data) |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterials = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsMaterial', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterial/clone', data) |
| | | } |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/hIAWms/wmsMaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hIAWms/wmsMaterial/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/WmsEnum', data) |
| | | } |
| | | |
| | | // /** |
| | | // * è·åç©æåºç¡å表 |
| | | // * @returns |
| | | // */ |
| | | // export const getWmsDataList = (data: any) => { |
| | | // return request.post('/api/v1/hIAWms/wmsmaterial/page', data) |
| | | // } |
| | | |
| | | /** |
| | | * è·åä»åºå表 |
| | | * @returns |
| | | */ |
| | | export const getStoreDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/StoreList') |
| | | } |
| | | |
| | | /** |
| | | * è·ååºåºå表 |
| | | * @returns |
| | | */ |
| | | export const getAreaAreaDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/AreaList') |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterial/${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 addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/hIAWms/wmsMaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hIAWms/wmsMaterial/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/WmsEnum', data) |
| | | } |
| | | |
| | | /** |
| | | * è·åç©æåºç¡å表 |
| | | * @returns |
| | | */ |
| | | export const getWmsDataList = (data: any) => { |
| | | return request.post('/api/v1/hIAWms/wmsmaterial/page', data) |
| | | } |
| | | |
| | | /** |
| | | * è·åä»åºå表 |
| | | * @returns |
| | | */ |
| | | export const getStoreDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/StoreList') |
| | | } |
| | | |
| | | /** |
| | | * è·ååºåºå表 |
| | | * @returns |
| | | */ |
| | | export const getAreaAreaDataList = () => { |
| | | return request.get('/api/v1/hIAWms/WmsEnum/AreaList') |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterial/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterials, |
| | | addWmsMaterial, |
| | | cloneData, |
| | | } from './Service/WmsMaterial' |
| | | |
| | | export class WmsMaterial extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterials(ids: string[]) { |
| | | return deleteWmsMaterials(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterials, |
| | | addWmsMaterial, |
| | | cloneData, |
| | | } from './Service/WmsMaterial' |
| | | |
| | | export class WmsMaterial extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterials(ids: string[]) { |
| | | return deleteWmsMaterials(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | getWmsEnumData, |
| | | } from './Service/WmsMaterialDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | getWmsEnumData, |
| | | } from './Service/WmsMaterialDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | getWmsEnumData, |
| | | } from './Service/WmsMaterialQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | getWmsEnumData, |
| | | } from './Service/WmsMaterialQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
| | |
| | | .HIAWms { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #dbdbdb; |
| | | } |
| | | .HIAWms { |
| | | 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 './HIAWms.module.scss' |
| | | // import WmsContainer from './Pages/HIAWms/WmsContainer' |
| | | 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: 'WmsMaterial', label: 'ç©æåºç¡' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'HIAWms', |
| | | |
| | | 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 WmsMaterial = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: WmsMaterial, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.HIAWms}> |
| | | <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['WmsMaterial'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
| | | import { |
| | | Component, |
| | | DefineComponent, |
| | | defineComponent, |
| | | markRaw, |
| | | ref, |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './HIAWms.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: 'WmsMaterial', label: 'ç©æä¿¡æ¯' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'HIAWms', |
| | | |
| | | 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 WmsMaterial = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: WmsMaterial, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.HIAWms}> |
| | | <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['WmsMaterial'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
| | | .drawer { |
| | | width: 800px; |
| | | } |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsMaterialDrawer.module.scss' |
| | | import { useWmsMaterialDrawer } from '../../../../Controllers/WmsMaterialDrawer.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, |
| | | } = useWmsMaterialDrawer(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> |
| | | ) |
| | | }, |
| | | }) |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsMaterialDrawer.module.scss' |
| | | import { useWmsMaterialDrawer } from '../../../../Controllers/WmsMaterialDrawer.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, |
| | | } = useWmsMaterialDrawer(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; |
| | | } |
| | | .drawer { |
| | | width: 800px; |
| | | } |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsMaterialQueryDrawer.module.scss' |
| | | import { useWmsMaterialQueryDrawer } from '../../../../Controllers/WmsMaterialQueryDrawer.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, |
| | | } = useWmsMaterialQueryDrawer(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> |
| | | ) |
| | | }, |
| | | }) |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsMaterialQueryDrawer.module.scss' |
| | | import { useWmsMaterialQueryDrawer } from '../../../../Controllers/WmsMaterialQueryDrawer.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, |
| | | } = useWmsMaterialQueryDrawer(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: 'materialCode', |
| | | title: 'ç©æç¼ç ', |
| | | }, |
| | | { |
| | | field: 'materialName', |
| | | title: 'ç©æåç§°', |
| | | }, |
| | | { |
| | | field: 'purchaseTypeDesc', |
| | | title: 'éè´ç±»å', |
| | | }, |
| | | { |
| | | field: 'materialTypeDesc', |
| | | title: 'ç©æç±»å', |
| | | }, |
| | | { |
| | | field: 'primaryUnit', |
| | | title: '主åä½', |
| | | }, |
| | | { |
| | | field: 'standard', |
| | | title: 'è§æ ¼/æ å', |
| | | }, |
| | | { |
| | | field: 'outerDiameter', |
| | | title: 'å¤å¾(mm)', |
| | | }, |
| | | { |
| | | field: 'wallThickness', |
| | | title: 'å£å(mm)', |
| | | }, |
| | | { |
| | | field: 'materialQuality', |
| | | title: 'æè´¨', |
| | | }, |
| | | { |
| | | field: 'length', |
| | | title: 'é¿åº¦(m)', |
| | | }, |
| | | { |
| | | field: 'isMainBranchDesc', |
| | | title: 'æ¯å¦ä¸»æ¯ç®¡', |
| | | }, |
| | | { |
| | | field: 'factory', |
| | | title: 'ç产工å', |
| | | }, |
| | | { |
| | | field: 'certification', |
| | | title: 'è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | field: 'remark', |
| | | title: '夿³¨', |
| | | }, |
| | | ] |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'materialCode', |
| | | title: 'ç©æç¼ç ï¼å¯ä¸æ è¯ï¼', |
| | | }, |
| | | { |
| | | field: 'materialName', |
| | | title: 'ç©æåç§°', |
| | | }, |
| | | { |
| | | field: 'purchaseTypeDesc', |
| | | title: 'éè´ç±»åï¼æä¸¾å¼ï¼', |
| | | }, |
| | | { |
| | | field: 'materialTypeDesc', |
| | | title: 'ç©æç±»åï¼æä¸¾å¼ï¼', |
| | | }, |
| | | { |
| | | field: 'primaryUnit', |
| | | title: '主åä½ï¼å¦ï¼kgãmã个ï¼', |
| | | }, |
| | | { |
| | | field: 'standard', |
| | | title: 'è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼', |
| | | }, |
| | | { |
| | | field: 'outerDiameter', |
| | | title: 'å¤å¾ï¼åä½ï¼mmï¼', |
| | | }, |
| | | { |
| | | field: 'wallThickness', |
| | | title: 'å£åï¼åä½ï¼mmï¼', |
| | | }, |
| | | { |
| | | field: 'materialQuality', |
| | | title: 'æè´¨ï¼å¦ï¼304ä¸éé¢ï¼', |
| | | }, |
| | | { |
| | | field: 'length', |
| | | title: 'é¿åº¦ï¼åä½ï¼mï¼', |
| | | }, |
| | | { |
| | | field: 'isMainBranchDesc', |
| | | title: 'æ¯å¦ä¸ºä¸»æ¯ç®¡', |
| | | }, |
| | | { |
| | | field: 'factory', |
| | | title: 'ç产工å', |
| | | }, |
| | | { |
| | | field: 'certification', |
| | | title: 'è¯ä¹¦ç¼å·', |
| | | }, |
| | | { |
| | | field: 'redundantField1', |
| | | title: 'åä½å段1 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | field: 'redundantField2', |
| | | title: 'åä½å段2 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | field: 'redundantField3', |
| | | title: 'åä½å段3 - é¢çæ©å±ç¨é', |
| | | }, |
| | | { |
| | | field: 'sort', |
| | | title: 'æåº', |
| | | }, |
| | | { |
| | | field: 'remark', |
| | | title: '夿³¨', |
| | | }, |
| | | { |
| | | field: 'isDisabled', |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | }, |
| | | { |
| | | field: 'creationTime', |
| | | title: '', |
| | | }, |
| | | { |
| | | field: 'deletionTime', |
| | | title: '', |
| | | }, |
| | | ] |
| | |
| | | .wmsMaterialContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .wmsMaterialList { |
| | | 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%; |
| | | } |
| | | } |
| | | .wmsMaterialContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .wmsMaterialList { |
| | | 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 './WmsMaterial.module.scss' |
| | | import { useWmsMaterial } from '../../../Controllers/WmsMaterial' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import WmsMaterialDrawer from '../Dialog/WmsMaterialDrawer/WmsMaterialDrawer' |
| | | import WmsMaterialQueryDrawer from '../Dialog/WmsMaterialQueryDrawer/WmsMaterialQueryDrawer' |
| | | 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/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | 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: 'WmsMaterial', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | | setup(props, ctx) { |
| | | const { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | headers, |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddWmsMaterial, |
| | | onAdvancedQuery, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsMaterial(props, ctx) |
| | | |
| | | //å®ä¹é«çº§æ¥è¯¢å¼ç¨ |
| | | const wmsMaterialQueryDrawerRef=ref(null); |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | const queryForm = ref({ |
| | | searchVal: '', |
| | | str_searchFormInputAttrs:[] |
| | | }) |
| | | //å®ä¹æ´ä½æ¨¡ç³æ¥è¯¢çåæ°ç»(注æï¼å¿
须大å°åè·å端çå®ä½ç±»å±æ§åä¸è´ï¼å¦åä¼å¯¼è´å¹é
ä¸å¯¹çé®é¢) |
| | | const _searchFormInputAttrs = ref([ |
| | | 'MaterialCode', |
| | | 'MaterialName', |
| | | 'Remark' |
| | | ]); |
| | | const searchFormInputAttrs_Placeholder = ref('请è¾å
¥ç©æç¼ç /ç©æåç§°/夿³¨'); |
| | | import { computed, defineComponent, onMounted, reactive, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './WmsMaterial.module.scss' |
| | | import { useWmsMaterial } from '../../../Controllers/WmsMaterial' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import WmsMaterialDrawer from '../Dialog/WmsMaterialDrawer/WmsMaterialDrawer' |
| | | import WmsMaterialQueryDrawer from '../Dialog/WmsMaterialQueryDrawer/WmsMaterialQueryDrawer' |
| | | 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/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | 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: 'WmsMaterial', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | | setup(props, ctx) { |
| | | const { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | headers, |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddWmsMaterial, |
| | | onAdvancedQuery, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsMaterial(props, ctx) |
| | | |
| | | //å®ä¹é«çº§æ¥è¯¢å¼ç¨ |
| | | const wmsMaterialQueryDrawerRef=ref(null); |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | const queryForm = ref({ |
| | | searchVal: '', |
| | | str_searchFormInputAttrs:[] |
| | | }) |
| | | //å®ä¹æ´ä½æ¨¡ç³æ¥è¯¢çåæ°ç»(注æï¼å¿
须大å°åè·å端çå®ä½ç±»å±æ§åä¸è´ï¼å¦åä¼å¯¼è´å¹é
ä¸å¯¹çé®é¢) |
| | | const _searchFormInputAttrs = ref([ |
| | | 'MaterialCode', 'MaterialName', 'Remark' |
| | | ]); |
| | | const searchFormInputAttrs_Placeholder = ref('请è¾å
¥ç©æç¼ç /ç©æåç§°/夿³¨'); |
| | | |
| | | |
| | | // 卿æä¸¾é项 |
| | | const enumOptions = reactive({ |
| | | purchaseType: [] as Array<{label: string; value: any }>, |
| | | materialType: [] as Array<{label: string; value: any }>, |
| | | isMainBranch: [] as Array<{label: string; value: any }>, |
| | | }) |
| | | |
| | | // è·åæä¸¾æ°æ® |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | const purchaseTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | enumOptions.purchaseType = purchaseTypeEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | const materialTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | enumOptions.materialType = materialTypeEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | const yesNoEnumData = await getWmsEnumData({ |
| | | EnumName: 'YesNoEnum', |
| | | }) |
| | | enumOptions.isMainBranch = yesNoEnumData.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; |
| | | } |
| | | |
| | | |
| | | // 卿æä¸¾é项 |
| | | const enumOptions = reactive({ |
| | | materialType: [] as Array<{ label: string; value: any }>, |
| | | purchaseType: [] as Array<{ label: string; value: any }>, |
| | | isMainBranch: [] as Array<{ label: string; value: any }>, |
| | | }) |
| | | |
| | | // è·åæä¸¾æ°æ® |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | // è·åç©æç±»åæä¸¾ |
| | | const materialTypeData = await getWmsEnumData({ |
| | | EnumName: 'MaterialTypeEnum', |
| | | }) |
| | | enumOptions.materialType = materialTypeData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | // è·åéè´ç±»åæä¸¾ |
| | | const purchaseTypeData = await getWmsEnumData({ |
| | | EnumName: 'PurchaseTypeEnum', |
| | | }) |
| | | enumOptions.purchaseType = purchaseTypeData.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.wmsMaterialList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/hIAWms/wmsMaterial/{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.wmsMaterialContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <WmsMaterialDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsMaterial} |
| | | /> |
| | | {/* é«çº§æ¥è¯¢ */} |
| | | <WmsMaterialQueryDrawer |
| | | ref="wmsMaterialQueryDrawerRef" |
| | | 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="wmsMaterial-add" |
| | | icon="add-p" |
| | | onClick={onAddWmsMaterial} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="wmsMaterial-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/wmsMaterial/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="wmsMaterial-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="wmsMaterial-add" |
| | | icon="search" |
| | | onClick={onAdvancedQuery} |
| | | type="primary" |
| | | > |
| | | é«çº§æ¥è¯¢ |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </div> |
| | | |
| | | <RenderBaseTable |
| | | url="/api/v1/hIAWms/wmsMaterial/page" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | | */ |
| | | const RenderBaseTable = (props: RenderTableType) => { |
| | | const { |
| | | url, |
| | | dataSource, |
| | | isDrag, |
| | | isChecked, |
| | | isHidePagination, |
| | | params, |
| | | autoHeight, |
| | | } = props |
| | | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.wmsMaterialList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/HIAWms/wmsMaterial/{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.wmsMaterialContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <WmsMaterialDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsMaterial} |
| | | /> |
| | | {/* é«çº§æ¥è¯¢ */} |
| | | <WmsMaterialQueryDrawer |
| | | ref="wmsMaterialQueryDrawerRef" |
| | | 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="wmsMaterial-add" |
| | | icon="add-p" |
| | | onClick={onAddWmsMaterial} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="wmsMaterial-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/wmsMaterial/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="wmsMaterial-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="wmsMaterial-add" |
| | | icon="search" |
| | | onClick={onAdvancedQuery} |
| | | type="primary" |
| | | > |
| | | é«çº§æ¥è¯¢ |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </div> |
| | | |
| | | <RenderBaseTable |
| | | url="/api/v1/HIAWms/wmsMaterial/page" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsMaterial" |
| | | } |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmsMaterial-list': 'å表-å表', |
| | | 'wmsMaterial-add': 'å表-æ·»å ', |
| | | 'wmsMaterial-import': 'å表-导å
¥', |
| | | 'wmsMaterial-output': 'å表-è¾åº', |
| | | } |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmsMaterial-list': 'å表-å表', |
| | | 'wmsMaterial-add': 'å表-æ·»å ', |
| | | 'wmsMaterial-import': 'å表-导å
¥', |
| | | 'wmsMaterial-output': 'å表-è¾åº', |
| | | } |
| | |
| | | import HIAWms from './Views/HIAWms' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'HIAWms', |
| | | name: 'Wmsç©æåºç¡', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(HIAWms), |
| | | settingsView: Setting, |
| | | } |
| | | import HIAWms from './Views/HIAWms' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'HIAWms', |
| | | name: 'ç©æä¿¡æ¯', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(HIAWms), |
| | | settingsView: Setting, |
| | | } |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsContainerBaseType { |
| | | 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 |
| | | } |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsMaterialBaseType { |
| | | 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 |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 { WmsInOutStockRecord } from '../Models/WmsInOutStockRecord' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsInOutStockRecord = (props: any, ctx?: any) => { |
| | | const wmsInOutStockRecord = injectModel<WmsInOutStockRecord>('wmsInOutStockRecord') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsInOutStockRecordColumns = 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 wmsInOutStockRecord.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { materialNo: string }) => item.materialNo) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.materialNo}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await wmsInOutStockRecord.deleteWmsInOutStockRecords(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsInOutStockRecord = () => { |
| | | 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 onConfirmWmsInOutStockRecord = 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/wmsInOutStockRecord/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, |
| | | wmsInOutStockRecordColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsInOutStockRecord, |
| | | onCheck, |
| | | onAddWmsInOutStockRecord, |
| | | onAdvancedQuery |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsInOutStockRecordDrawer } from '../Models/WmsInOutStockRecordDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsInOutStockRecordDrawer = (props: any, ctx?: any) => { |
| | | const wmsInOutStockRecordDrawer = injectModel<WmsInOutStockRecordDrawer>('wmsInOutStockRecordDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'orderNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åæ®ç¼å·', |
| | | rules: [{required: true, message: 'åæ®ç¼å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | }, |
| | | { |
| | | label: 'ç©æä»¶å·', |
| | | prop: 'materialNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æä»¶å·', |
| | | rules: [{required: true, message: 'ç©æä»¶å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'æä½ç±»å', |
| | | prop: 'stockType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æä½ç±»å', |
| | | rules: [{required: true, message: 'æä½ç±»åä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '容å¨ç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å®¹å¨ç¼å·', |
| | | }, |
| | | { |
| | | label: 'æºå', |
| | | prop: 'materialModel', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æºå', |
| | | }, |
| | | { |
| | | label: 'æä½æ¶é´', |
| | | prop: 'operateTime', |
| | | type: 'datetimerange', |
| | | el: 'date-picker', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æä½æ¶é´', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | rules: [{required: true, message: 'ç©æIDä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ä»»å¡å·', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡å·', |
| | | rules: [{required: true, message: 'ä»»å¡å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'èµ·å§åºä½', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //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 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 = { |
| | | orderNo: formData.value.orderNo, |
| | | materialName: formData.value.materialName, |
| | | materialNo: formData.value.materialNo, |
| | | stockType: formData.value.stockType, |
| | | containerNo: formData.value.containerNo, |
| | | materialModel: formData.value.materialModel, |
| | | operateTime: formData.value.operateTime, |
| | | remark: formData.value.remark, |
| | | materialId: formData.value.materialId, |
| | | taskNo: formData.value.taskNo, |
| | | sourcePlace: formData.value.sourcePlace, |
| | | toPlace: formData.value.toPlace, |
| | | } |
| | | if (!current.value) { |
| | | await wmsInOutStockRecordDrawer.addWmsInOutStockRecord(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsInOutStockRecordDrawer.updateWmsInOutStockRecord(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 stockTypeEnumEnum = await wmsInOutStockRecordDrawer.getWmsEnumData({ |
| | | EnumName: 'StockTypeEnum', |
| | | }) |
| | | updateFormItemOptions('stockType', stockTypeEnumEnum) |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await wmsInOutStockRecordDrawer.getWmsInOutStockRecordDetail(current.value) |
| | | |
| | | formData.value = { |
| | | orderNo: res.orderNo, |
| | | materialName: res.materialName, |
| | | materialNo: res.materialNo, |
| | | stockType: res.stockType, |
| | | containerNo: res.containerNo, |
| | | materialModel: res.materialModel, |
| | | operateTime: res.operateTime, |
| | | remark: res.remark, |
| | | materialId: res.materialId, |
| | | taskNo: res.taskNo, |
| | | sourcePlace: res.sourcePlace, |
| | | 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 { WmsInOutStockRecordDrawer } from '../Models/WmsInOutStockRecordDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsInOutStockRecordQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsInOutStockRecordDrawer = injectModel<WmsInOutStockRecordDrawer>('WmsInOutStockRecordDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'orderNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åæ®ç¼å·', |
| | | }, |
| | | { |
| | | label: 'ç©æåç§°', |
| | | prop: 'materialName', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æåç§°', |
| | | }, |
| | | { |
| | | label: 'ç©æä»¶å·', |
| | | prop: 'materialNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æä»¶å·', |
| | | }, |
| | | { |
| | | label: 'æä½ç±»å', |
| | | prop: 'stockType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æä½ç±»å', |
| | | }, |
| | | { |
| | | label: '容å¨ç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å®¹å¨ç¼å·', |
| | | }, |
| | | { |
| | | label: 'æºå', |
| | | prop: 'materialModel', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æºå', |
| | | }, |
| | | { |
| | | label: 'æä½æ¶é´', |
| | | prop: 'operateTime', |
| | | type: 'datetimerange', |
| | | el: 'date-picker', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æä½æ¶é´', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | }, |
| | | { |
| | | label: 'ä»»å¡å·', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä»»å¡å·', |
| | | }, |
| | | { |
| | | label: 'èµ·å§åºä½', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //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 = { |
| | | OrderNo: formData.value.OrderNo, |
| | | MaterialName: formData.value.MaterialName, |
| | | MaterialNo: formData.value.MaterialNo, |
| | | StockType: formData.value.StockType, |
| | | ContainerNo: formData.value.ContainerNo, |
| | | MaterialModel: formData.value.MaterialModel, |
| | | OperateTime: formData.value.OperateTime, |
| | | Remark: formData.value.Remark, |
| | | MaterialId: formData.value.MaterialId, |
| | | TaskNo: formData.value.TaskNo, |
| | | SourcePlace: formData.value.SourcePlace, |
| | | 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.OrderNo = '' |
| | | formData.value.MaterialName = '' |
| | | formData.value.MaterialNo = '' |
| | | formData.value.StockType = '' |
| | | formData.value.ContainerNo = '' |
| | | formData.value.MaterialModel = '' |
| | | formData.value.OperateTime = '' |
| | | formData.value.Remark = '' |
| | | formData.value.MaterialId = '' |
| | | formData.value.TaskNo = '' |
| | | formData.value.SourcePlace = '' |
| | | formData.value.ToPlace = '' |
| | | 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'); |
| | | } |
| | | |
| | | 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 stockTypeEnumEnum = await wmsInOutStockRecordDrawer.getWmsEnumData({ |
| | | EnumName: 'StockTypeEnum', |
| | | }) |
| | | updateFormItemOptions('stockType', stockTypeEnumEnum) |
| | | |
| | | } |
| | | 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 addWmsInOutStockRecord = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsInOutStockRecord', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsInOutStockRecords = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsInOutStockRecord', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsInOutStockRecord/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsInOutStockRecord = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsInOutStockRecord', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsInOutStockRecord = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsInOutStockRecord/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsInOutStockRecord = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsInOutStockRecord/${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 addWmsInOutStockRecord = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsInOutStockRecord', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsInOutStockRecord = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsInOutStockRecord/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsInOutStockRecord = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsInOutStockRecord/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsInOutStockRecords, |
| | | addWmsInOutStockRecord, |
| | | cloneData, |
| | | } from './Service/WmsInOutStockRecord' |
| | | |
| | | export class WmsInOutStockRecord extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsInOutStockRecords(ids: string[]) { |
| | | return deleteWmsInOutStockRecords(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsInOutStockRecord(data: Record<string, any>) { |
| | | return addWmsInOutStockRecord(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsInOutStockRecord, |
| | | getWmsInOutStockRecord, |
| | | updateWmsInOutStockRecord, |
| | | getWmsEnumData, |
| | | } from './Service/WmsInOutStockRecordDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsInOutStockRecordDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsInOutStockRecord: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsInOutStockRecord(data: Record<string, any>) { |
| | | return addWmsInOutStockRecord(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsInOutStockRecord(id: string, data: Record<string, any>) { |
| | | return updateWmsInOutStockRecord(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsInOutStockRecordDetail(current: any, id?: string) { |
| | | return getWmsInOutStockRecord(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsInOutStockRecord, |
| | | getWmsInOutStockRecord, |
| | | updateWmsInOutStockRecord, |
| | | getWmsEnumData, |
| | | } from './Service/WmsInOutStockRecordQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsInOutStockRecordQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsInOutStockRecord: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsInOutStockRecord(data: Record<string, any>) { |
| | | return addWmsInOutStockRecord(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsInOutStockRecord(id: string, data: Record<string, any>) { |
| | | return updateWmsInOutStockRecord(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsInOutStockRecordDetail(current: any, id?: string) { |
| | | return getWmsInOutStockRecord(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 './WmsInOutStockRecordDrawer.module.scss' |
| | | import { useWmsInOutStockRecordDrawer } from '../../../../Controllers/WmsInOutStockRecordDrawer.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, |
| | | } = useWmsInOutStockRecordDrawer(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 './WmsInOutStockRecordQueryDrawer.module.scss' |
| | | import { useWmsInOutStockRecordQueryDrawer } from '../../../../Controllers/WmsInOutStockRecordQueryDrawer.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, |
| | | } = useWmsInOutStockRecordQueryDrawer(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: '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: '', |
| | | }, |
| | | { |
| | | field: 'sort', |
| | | title: 'æåº', |
| | | }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .wmsInOutStockRecordContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .wmsInOutStockRecordList { |
| | | 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 './WmsInOutStockRecord.module.scss' |
| | | import { useWmsInOutStockRecord } from '../../../Controllers/WmsInOutStockRecord' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import WmsInOutStockRecordDrawer from '../Dialog/WmsInOutStockRecordDrawer/WmsInOutStockRecordDrawer' |
| | | import WmsInOutStockRecordQueryDrawer from '../Dialog/WmsInOutStockRecordQueryDrawer/WmsInOutStockRecordQueryDrawer' |
| | | 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/WmsInOutStockRecord/Models/Service/WmsInOutStockRecordDrawer' |
| | | 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: 'WmsInOutStockRecord', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | | setup(props, ctx) { |
| | | const { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | headers, |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmWmsInOutStockRecord, |
| | | onCheck, |
| | | onAddWmsInOutStockRecord, |
| | | onAdvancedQuery, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsInOutStockRecord(props, ctx) |
| | | |
| | | //å®ä¹é«çº§æ¥è¯¢å¼ç¨ |
| | | const wmsInOutStockRecordQueryDrawerRef=ref(null); |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | const queryForm = ref({ |
| | | searchVal: '', |
| | | str_searchFormInputAttrs:[] |
| | | }) |
| | | //å®ä¹æ´ä½æ¨¡ç³æ¥è¯¢çåæ°ç»(注æï¼å¿
须大å°åè·å端çå®ä½ç±»å±æ§åä¸è´ï¼å¦åä¼å¯¼è´å¹é
ä¸å¯¹çé®é¢) |
| | | const _searchFormInputAttrs = ref([ |
| | | 'MaterialNo', 'MaterialName', 'Remark' |
| | | ]); |
| | | const searchFormInputAttrs_Placeholder = ref('请è¾å
¥ç©æç¼ç /ç©æåç§°/夿³¨'); |
| | | |
| | | |
| | | // 卿æä¸¾é项 |
| | | const enumOptions = reactive({ |
| | | stockType: [] as Array<{label: string; value: any }>, |
| | | }) |
| | | |
| | | // è·åæä¸¾æ°æ® |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | const stockTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'StockTypeEnum', |
| | | }) |
| | | enumOptions.stockType = stockTypeEnumData.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.wmsInOutStockRecordList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/HIAWms/wmsInOutStockRecord/{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.wmsInOutStockRecordContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <WmsInOutStockRecordDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsInOutStockRecord} |
| | | /> |
| | | {/* é«çº§æ¥è¯¢ */} |
| | | <WmsInOutStockRecordQueryDrawer |
| | | ref="wmsInOutStockRecordQueryDrawerRef" |
| | | 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="wmsInOutStockRecord-add" |
| | | icon="add-p" |
| | | onClick={onAddWmsInOutStockRecord} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="wmsInOutStockRecord-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/wmsInOutStockRecord/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="wmsInOutStockRecord-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="wmsInOutStockRecord-add" |
| | | icon="search" |
| | | onClick={onAdvancedQuery} |
| | | type="primary" |
| | | > |
| | | é«çº§æ¥è¯¢ |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </div> |
| | | |
| | | <RenderBaseTable |
| | | url="/api/v1/HIAWms/wmsInOutStockRecord/page" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .WmsInOutStockRecord { |
| | | 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 './WmsInOutStockRecord.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: 'WmsInOutStockRecord', label: 'åºå
¥åºè®°å½' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'WmsInOutStockRecord', |
| | | |
| | | 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 WmsInOutStockRecord = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: WmsInOutStockRecord, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.WmsInOutStockRecord}> |
| | | <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['WmsInOutStockRecord'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsInOutStockRecord" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmsInOutStockRecord-list': 'å表-å表', |
| | | 'wmsInOutStockRecord-add': 'å表-æ·»å ', |
| | | 'wmsInOutStockRecord-import': 'å表-导å
¥', |
| | | 'wmsInOutStockRecord-output': 'å表-è¾åº', |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import WmsInOutStockRecord from './Views/WmsInOutStockRecord' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'WmsInOutStockRecord', |
| | | name: 'åºå
¥åºè®°å½', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(WmsInOutStockRecord), |
| | | settingsView: Setting, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsInOutStockRecordBaseType { |
| | | 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 |
| | | } |