1
yangpeixing
2 天以前 c69b6892e9e004db9cf5d0edc69bbd2fcc1d83db
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs
@@ -76,6 +76,7 @@
        {
        }
        vueDictionaryDTOs = vueDictionaryDTOs.DistinctBy(d => d.DicNo).ToList();
        return Json(vueDictionaryDTOs);
    }
    private VueDictionaryDTO GetVueDictionary(string key)
@@ -576,7 +577,37 @@
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
                case "InventoryStatus":
                    {
                        List<object> data = new List<object>();
                        #region InventoryStatus
                        {
                            Type type = typeof(InventoryStatus);
                            List<int> enums = Enum.GetValues(typeof(InventoryStatus)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(InventoryStatus).GetField(((InventoryStatus)item).ToString());
                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = item.ToString(), value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = item.ToString(), value = item.ToString() });
                                }
                                index++;
                            }
                        }
                        #endregion
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
            }
            return result;
        }