浏览代码

增加许可证

LT069288 3 月之前
父节点
当前提交
ef5aa78c41

二进制
Document/被装材料数据库设计.docx


+ 2 - 0
UniformMaterialManagementSystem/App.xaml.cs

@@ -62,6 +62,7 @@ namespace UniformMaterialManagementSystem
             services.AddKeyedTransient<UserControl, InspectionReportPage>("InspectionReportPage");
             services.AddKeyedTransient<UserControl, SampleRegistrationPage>("SampleRegistrationPage");
             services.AddKeyedTransient<UserControl, InspectionOrganizationPage>("InspectionOrganizationPage");
+            services.AddKeyedTransient<UserControl, FactoryLicensePage>("FactoryLicensePage");
 
             // ViewModel 注册
             services.AddSingleton<MainWindowViewModel>();
@@ -83,6 +84,7 @@ namespace UniformMaterialManagementSystem
             services.AddTransient<InspectionReportPageViewModel>();
             services.AddTransient<SampleRegistrationPageViewModel>();
             services.AddTransient<InspectionOrganizationPageViewModel>();
+            services.AddTransient<FactoryLicensePageViewModel>();
 
             // Service 注册
             services.AddScoped(typeof(IDataBaseService<>), typeof(DataBaseService<>));

+ 3 - 1
UniformMaterialManagementSystem/Data/SqliteContext.cs

@@ -48,7 +48,9 @@ namespace UniformMaterialManagementSystem.Data
 
         public DbSet<SampleRegistration> SampleRegistrations { get; set; }
 
-        public DbSet<InspectionOrganization> InspectionOrganizations { get;set; }
+        public DbSet<InspectionOrganization> InspectionOrganizations { get; set; }
+
+        public DbSet<FactoryLicense> FactoryLicenses { get; set; }
 
 
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)

+ 42 - 0
UniformMaterialManagementSystem/Entities/FactoryLicense.cs

@@ -0,0 +1,42 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace UniformMaterialManagementSystem.Entities
+{
+    /// <summary>
+    /// 出厂许可证
+    /// </summary>
+    public class FactoryLicense
+    {
+        [Key]
+        public Guid Guid { get; set; } = Guid.NewGuid();
+
+        public Guid InspectApplyGuid { get; set; }
+
+        [StringLength(50)]
+        public string LicenseNo { get; set; } = null!;
+
+        [StringLength(50)]
+        public string LicenseListNo { get; set; } = null!;
+
+        public DateTime FactoryDate { get; set; }
+
+        public double FactoryQuantity { get; set; }
+
+        [StringLength(50)]
+        public string Department { get; set; } = null!;
+
+        public DateTime SignDate { get; set; }
+
+        [StringLength(50)]
+        public string EditUser { get; set; } = null!;
+
+        [StringLength(50)]
+        public string? ApproveUser { get; set; }
+
+        [StringLength(50)]
+        public string? AuditUser { get; set; }
+
+        public InspectApply InspectApply { get; set; } = null!;
+
+    }
+}

+ 1198 - 0
UniformMaterialManagementSystem/Migrations/20240805075305_AddFactoryLicense.Designer.cs

@@ -0,0 +1,1198 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using UniformMaterialManagementSystem.Data;
+
+#nullable disable
+
+namespace UniformMaterialManagementSystem.Migrations
+{
+    [DbContext(typeof(SqliteContext))]
+    [Migration("20240805075305_AddFactoryLicense")]
+    partial class AddFactoryLicense
+    {
+        /// <inheritdoc />
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder.HasAnnotation("ProductVersion", "7.0.20");
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Company", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Address")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Category")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Code")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Manager")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Note")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ShortName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SystemCode")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("Companies");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Contract", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<byte[]>("Attachment")
+                        .HasColumnType("BLOB");
+
+                    b.Property<Guid>("CompanyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ContractNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("EditDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("EditUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("ExportStatus")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<Guid>("PurchaseCompanyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("SigningDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Telephone")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("CompanyGuid");
+
+                    b.HasIndex("PurchaseCompanyGuid");
+
+                    b.ToTable("Contracts");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.ContractDetail", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ContractGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("ContractQty")
+                        .HasColumnType("REAL");
+
+                    b.Property<DateTime>("DeliveryTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("InspectStatus")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("InspectedQty")
+                        .HasColumnType("REAL");
+
+                    b.Property<Guid>("MaterialGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("ShippedQuantity")
+                        .HasColumnType("REAL");
+
+                    b.Property<double>("UnitPrice")
+                        .HasColumnType("REAL");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("ContractGuid");
+
+                    b.HasIndex("MaterialGuid");
+
+                    b.ToTable("ContractDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.DeliveryReceipt", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("BatchNo")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("CompanyName")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ContractGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ContractNo")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<decimal>("ContractQty")
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("ContractSigningDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<byte[]>("Licence")
+                        .HasColumnType("BLOB");
+
+                    b.Property<string>("MaterialName")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ProductCompanyName")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReceivedCompanyName")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime?>("ReceivedDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReceivedMan")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int?>("ReceivedPackets")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<decimal?>("ReceivedQty")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReceivedStatus")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReceivedTel")
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("ShippedDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ShippedMan")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("ShippedPackets")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<decimal>("ShippedQty")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ShippedTel")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("DeliveryReceipts");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.DeliveryReceiptDetail", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("DeliveryReceiptGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("PacketNo")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<decimal?>("ReceiveQuantity")
+                        .HasColumnType("TEXT");
+
+                    b.Property<decimal>("ShippedQuantity")
+                        .HasColumnType("TEXT");
+
+                    b.Property<decimal?>("UseQuantity")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("UseStatus")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("DeliveryReceiptGuid");
+
+                    b.ToTable("DeliveryReceiptDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.FactoryLicense", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApproveUser")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("AuditUser")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Department")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("EditUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("FactoryDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("FactoryQuantity")
+                        .HasColumnType("REAL");
+
+                    b.Property<Guid>("InspectApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("LicenseListNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("LicenseNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("SignDate")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("InspectApplyGuid");
+
+                    b.ToTable("FactoryLicenses");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApply", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApplyDescription")
+                        .HasMaxLength(1000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApplyNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime?>("ApplyReceiveDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApplyUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("BatchNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Company")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("CompanyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("EndProductDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("InspCategory")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("InspDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("InspQuantity")
+                        .HasColumnType("REAL");
+
+                    b.Property<byte[]>("InspReport")
+                        .HasColumnType("BLOB");
+
+                    b.Property<string>("InspReportNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("LicenseStatus")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<Guid>("MaterialGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ProductName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("ReportStatus")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("SampleStatus")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<DateTime>("StartProductDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Year")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("CompanyGuid");
+
+                    b.HasIndex("MaterialGuid");
+
+                    b.ToTable("InspectApplies");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApplyContractDetail", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApplyNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ContractDetailGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ContractNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("InspectQty")
+                        .HasColumnType("REAL");
+
+                    b.Property<string>("PurchaseCompany")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("PurchaseCompanyShortName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SigningDate")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("UnInspectQty")
+                        .HasColumnType("REAL");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("ApplyGuid");
+
+                    b.ToTable("InspectApplyContractDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApplyDetail", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("ApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApplyNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Note")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("PacketNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("Quantity")
+                        .HasColumnType("REAL");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("ApplyGuid");
+
+                    b.ToTable("InspectApplyDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionOrganization", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Address")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Contacts")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("OrderNo")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Telephone")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("InspectionOrganizations");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionReport", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Conclusion")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ConclusionDesc")
+                        .IsRequired()
+                        .HasMaxLength(1000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Department")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("EditUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("InspectApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsSample")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("ReportBasis")
+                        .IsRequired()
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReportDesc")
+                        .IsRequired()
+                        .HasMaxLength(1000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ReportNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("ReportTime")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("InspectApplyGuid");
+
+                    b.ToTable("InspectionReports");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionReportDetail", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("InspectionReportGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Inspector")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("JobCategory")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SupervisionUnit")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("InspectionReportGuid");
+
+                    b.ToTable("InspectionReportDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Material", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("CategoryCode")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("MeasureUnit")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("NormName")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Note")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Specification")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("VarietyCode")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("Materials");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.MenuItem", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Icon")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("IsVisible")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("OrderIndex")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<Guid?>("ParentGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Path")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("ParentGuid");
+
+                    b.ToTable("MenuItems");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Role", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("Roles");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.RoleMenuItem", b =>
+                {
+                    b.Property<Guid>("MenuItemGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("RoleGuid")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("MenuItemGuid", "RoleGuid");
+
+                    b.HasIndex("RoleGuid");
+
+                    b.ToTable("RoleMenuItems");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.SampleRegistration", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("BatchNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Department")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("EditTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("EditUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("InspectApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("InspectionOrganization")
+                        .IsRequired()
+                        .HasMaxLength(500)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("PacketNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("ProductDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ProductUsers")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("Quantity")
+                        .HasColumnType("REAL");
+
+                    b.Property<string>("SampleNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SingleIndexItem")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Telephone")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("TestingItem")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("InspectApplyGuid");
+
+                    b.ToTable("SampleRegistrations");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.SerialNumber", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("CompanyCode")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("CompanyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("InspCategory")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("MaxNumber")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("SupervisionUnitGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Year")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("SerialNumbers");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.SupervisionUnit", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Note")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ShortName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.ToTable("SupervisionUnits");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.User", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid?>("CompanyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("CompanyName")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("IdNumber")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("IsEnabled")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("LoginName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Password")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("RegisterDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Salt")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("SupervisionUnitGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("UserName")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("CompanyGuid");
+
+                    b.HasIndex("SupervisionUnitGuid");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.UserRole", b =>
+                {
+                    b.Property<Guid>("RoleGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<Guid>("UserGuid")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("RoleGuid", "UserGuid");
+
+                    b.HasIndex("UserGuid");
+
+                    b.ToTable("UserRoles");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Contract", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Company", "Company")
+                        .WithMany()
+                        .HasForeignKey("CompanyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Company", "PurchaseCompany")
+                        .WithMany()
+                        .HasForeignKey("PurchaseCompanyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Company");
+
+                    b.Navigation("PurchaseCompany");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.ContractDetail", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Contract", "Contract")
+                        .WithMany("ContractDetails")
+                        .HasForeignKey("ContractGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Material", "Material")
+                        .WithMany()
+                        .HasForeignKey("MaterialGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Contract");
+
+                    b.Navigation("Material");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.DeliveryReceiptDetail", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.DeliveryReceipt", null)
+                        .WithMany("DeliveryReceiptDetails")
+                        .HasForeignKey("DeliveryReceiptGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.FactoryLicense", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany()
+                        .HasForeignKey("InspectApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApply", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Company", "MaterialCompany")
+                        .WithMany()
+                        .HasForeignKey("CompanyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Material", "Material")
+                        .WithMany()
+                        .HasForeignKey("MaterialGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Material");
+
+                    b.Navigation("MaterialCompany");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApplyContractDetail", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany("InspectApplyContractDetails")
+                        .HasForeignKey("ApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApplyDetail", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany("InspectApplyDetails")
+                        .HasForeignKey("ApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionReport", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany()
+                        .HasForeignKey("InspectApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionReportDetail", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectionReport", "InspectionReport")
+                        .WithMany("InspectionReportDetails")
+                        .HasForeignKey("InspectionReportGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectionReport");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.MenuItem", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.MenuItem", "Parent")
+                        .WithMany("Children")
+                        .HasForeignKey("ParentGuid")
+                        .OnDelete(DeleteBehavior.Restrict);
+
+                    b.Navigation("Parent");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.RoleMenuItem", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.MenuItem", "MenuItem")
+                        .WithMany("MenuRoles")
+                        .HasForeignKey("MenuItemGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Role", "Role")
+                        .WithMany("RoleMenus")
+                        .HasForeignKey("RoleGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("MenuItem");
+
+                    b.Navigation("Role");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.SampleRegistration", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany()
+                        .HasForeignKey("InspectApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.User", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Company", "Company")
+                        .WithMany()
+                        .HasForeignKey("CompanyGuid");
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.SupervisionUnit", "SupervisionUnit")
+                        .WithMany()
+                        .HasForeignKey("SupervisionUnitGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Company");
+
+                    b.Navigation("SupervisionUnit");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.UserRole", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.Role", "Role")
+                        .WithMany("UserRoles")
+                        .HasForeignKey("RoleGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("UniformMaterialManagementSystem.Entities.User", "User")
+                        .WithMany("UserRoles")
+                        .HasForeignKey("UserGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Role");
+
+                    b.Navigation("User");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Contract", b =>
+                {
+                    b.Navigation("ContractDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.DeliveryReceipt", b =>
+                {
+                    b.Navigation("DeliveryReceiptDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApply", b =>
+                {
+                    b.Navigation("InspectApplyContractDetails");
+
+                    b.Navigation("InspectApplyDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectionReport", b =>
+                {
+                    b.Navigation("InspectionReportDetails");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.MenuItem", b =>
+                {
+                    b.Navigation("Children");
+
+                    b.Navigation("MenuRoles");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.Role", b =>
+                {
+                    b.Navigation("RoleMenus");
+
+                    b.Navigation("UserRoles");
+                });
+
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.User", b =>
+                {
+                    b.Navigation("UserRoles");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}

+ 54 - 0
UniformMaterialManagementSystem/Migrations/20240805075305_AddFactoryLicense.cs

@@ -0,0 +1,54 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace UniformMaterialManagementSystem.Migrations
+{
+    /// <inheritdoc />
+    public partial class AddFactoryLicense : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "FactoryLicenses",
+                columns: table => new
+                {
+                    Guid = table.Column<Guid>(type: "TEXT", nullable: false),
+                    InspectApplyGuid = table.Column<Guid>(type: "TEXT", nullable: false),
+                    LicenseNo = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
+                    LicenseListNo = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
+                    FactoryDate = table.Column<DateTime>(type: "TEXT", nullable: false),
+                    FactoryQuantity = table.Column<double>(type: "REAL", nullable: false),
+                    Department = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
+                    SignDate = table.Column<DateTime>(type: "TEXT", nullable: false),
+                    EditUser = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
+                    ApproveUser = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
+                    AuditUser = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_FactoryLicenses", x => x.Guid);
+                    table.ForeignKey(
+                        name: "FK_FactoryLicenses_InspectApplies_InspectApplyGuid",
+                        column: x => x.InspectApplyGuid,
+                        principalTable: "InspectApplies",
+                        principalColumn: "Guid",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_FactoryLicenses_InspectApplyGuid",
+                table: "FactoryLicenses",
+                column: "InspectApplyGuid");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "FactoryLicenses");
+        }
+    }
+}

+ 64 - 0
UniformMaterialManagementSystem/Migrations/SqliteContextModelSnapshot.cs

@@ -271,6 +271,59 @@ namespace UniformMaterialManagementSystem.Migrations
                     b.ToTable("DeliveryReceiptDetails");
                 });
 
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.FactoryLicense", b =>
+                {
+                    b.Property<Guid>("Guid")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ApproveUser")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("AuditUser")
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Department")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("EditUser")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("FactoryDate")
+                        .HasColumnType("TEXT");
+
+                    b.Property<double>("FactoryQuantity")
+                        .HasColumnType("REAL");
+
+                    b.Property<Guid>("InspectApplyGuid")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("LicenseListNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("LicenseNo")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("SignDate")
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("Guid");
+
+                    b.HasIndex("InspectApplyGuid");
+
+                    b.ToTable("FactoryLicenses");
+                });
+
             modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApply", b =>
                 {
                     b.Property<Guid>("Guid")
@@ -946,6 +999,17 @@ namespace UniformMaterialManagementSystem.Migrations
                         .IsRequired();
                 });
 
+            modelBuilder.Entity("UniformMaterialManagementSystem.Entities.FactoryLicense", b =>
+                {
+                    b.HasOne("UniformMaterialManagementSystem.Entities.InspectApply", "InspectApply")
+                        .WithMany()
+                        .HasForeignKey("InspectApplyGuid")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("InspectApply");
+                });
+
             modelBuilder.Entity("UniformMaterialManagementSystem.Entities.InspectApply", b =>
                 {
                     b.HasOne("UniformMaterialManagementSystem.Entities.Company", "MaterialCompany")

+ 80 - 0
UniformMaterialManagementSystem/Models/FactoryLicenseModel.cs

@@ -0,0 +1,80 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using System.Text;
+using UniformMaterialManagementSystem.Entities;
+
+namespace UniformMaterialManagementSystem.Models
+{
+    public partial class FactoryLicenseModel : ObservableObject
+    {
+        [ObservableProperty]
+        private Guid _guid;
+
+        [ObservableProperty]
+        private Guid _inspectApplyGuid;
+
+        [ObservableProperty]
+        private string _licenseNo = null!;
+
+        [ObservableProperty]
+        private string _licenseListNo = null!;
+
+        [ObservableProperty]
+        private DateTime _factoryDate;
+
+        [ObservableProperty]
+        private double _factoryQuantity;
+
+        [ObservableProperty]
+        private string _department = null!;
+
+        [ObservableProperty]
+        private DateTime _signDate;
+
+        [ObservableProperty]
+        private string _editUser = null!;
+
+        [ObservableProperty]
+        private string? _approveUser;
+
+        [ObservableProperty]
+        private string? _auditUser;
+
+        [ObservableProperty]
+        private string? _contractNos;
+
+        [ObservableProperty]
+        private string? _productDate;
+
+        [ObservableProperty]
+        private string? _inspectionReportNo;
+
+        [ObservableProperty]
+        private InspectApply _inspectApply = null!;
+
+        public FactoryLicenseModel(FactoryLicense factoryLicense)
+        {
+            Guid = factoryLicense.Guid;
+            InspectApplyGuid = factoryLicense.InspectApplyGuid;
+            LicenseNo = factoryLicense.LicenseNo;
+            LicenseListNo = factoryLicense.LicenseListNo;
+            FactoryDate = factoryLicense.FactoryDate;
+            FactoryQuantity = factoryLicense.FactoryQuantity;
+            Department = factoryLicense.Department;
+            SignDate = factoryLicense.SignDate;
+            EditUser = factoryLicense.EditUser;
+            ApproveUser = factoryLicense.ApproveUser;
+            AuditUser = factoryLicense.AuditUser;
+            InspectApply = factoryLicense.InspectApply;
+            ProductDate = factoryLicense.InspectApply.StartProductDate.ToString("yyyy-MM-dd") + "至"+factoryLicense.InspectApply.EndProductDate.ToString("yyyy-MM-dd");
+            InspectionReportNo = factoryLicense.InspectApply.ApplyNo.Replace("申请", "");
+
+            StringBuilder sb = new StringBuilder();
+            foreach (var detail in InspectApply.InspectApplyContractDetails)
+            {
+                sb.AppendLine(detail.ContractNo);
+            }
+
+            ContractNos = sb.ToString();
+        }
+    }
+}

二进制
UniformMaterialManagementSystem/Resources/Pictures/FactoryLicense.png


+ 2 - 0
UniformMaterialManagementSystem/UniformMaterialManagementSystem.csproj

@@ -15,6 +15,7 @@
 		<None Remove="Resources\Fonts\FluentSystemIcons-Regular.ttf" />
 		<None Remove="Resources\Pictures\Contract.png" />
 		<None Remove="Resources\Pictures\DeliveryReceipt.png" />
+		<None Remove="Resources\Pictures\FactoryLicense.png" />
 		<None Remove="Resources\Pictures\InspectApply.png" />
 		<None Remove="Resources\Pictures\InspectionRecord.png" />
 		<None Remove="Resources\Pictures\InspectionReport.png" />
@@ -36,6 +37,7 @@
 		  <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 		</Resource>
 		<Resource Include="Resources\Pictures\DeliveryReceipt.png" />
+		<Resource Include="Resources\Pictures\FactoryLicense.png" />
 		<Resource Include="Resources\Pictures\InspectApply.png">
 		  <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 		</Resource>

+ 93 - 0
UniformMaterialManagementSystem/ViewModels/FactoryLicensePageViewModel.cs

@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using Microsoft.EntityFrameworkCore;
+using UniformMaterialManagementSystem.Entities;
+using UniformMaterialManagementSystem.Models;
+using UniformMaterialManagementSystem.Services;
+using UniformMaterialManagementSystem.Views;
+
+namespace UniformMaterialManagementSystem.ViewModels
+{
+    public partial class FactoryLicensePageViewModel :ObservableObject
+    {
+        [ObservableProperty]
+        private FactoryLicenseModel? _selectedFactoryLicense;
+
+        [ObservableProperty]
+        private ObservableCollection<FactoryLicenseModel> _factoryLicenses = [];
+
+        private readonly IDataBaseService<FactoryLicense> _licenceService;
+        private readonly IDataBaseService<InspectApply> _inspectApplyService;
+        private readonly IDataBaseService<InspectionReport> _reportService;
+        public FactoryLicensePageViewModel(IDataBaseService<FactoryLicense> licenceService,IDataBaseService<InspectApply> inspectApplyService,IDataBaseService<InspectionReport> reportService)
+        {
+            _licenceService = licenceService;
+            _inspectApplyService = inspectApplyService;
+            _reportService = reportService;
+
+            LoadData();
+        }
+
+        private void LoadData()
+        {
+            var licenses = _licenceService.Query()
+                    .Include(x=>x.InspectApply)
+                    .ThenInclude(x=>x.InspectApplyContractDetails)
+                    .Include(x=>x.InspectApply)
+                    .ThenInclude(x=>x.Material);
+            foreach (var license in licenses)
+            {
+                FactoryLicenses.Add(new FactoryLicenseModel(license));
+            }
+        }
+
+        /// <summary>
+        /// 新增
+        /// </summary>
+        [RelayCommand]
+        private void AddFactoryLicence()
+        {
+            /* 打开窗口,展示检验报告状态未生成的检验申请列表,选择检验申请,携带检验申请数据 */
+            SelectInspectApplyWindowViewModel viewModel =
+                new SelectInspectApplyWindowViewModel(_inspectApplyService, "FactoryLicense");
+            SelectInspectApplyWindow inspectApplyWindow = new SelectInspectApplyWindow(viewModel);
+
+            var result = inspectApplyWindow.ShowDialog();
+            if (result == null || !(bool)result) return;
+
+            var inspectApply = inspectApplyWindow.DataGridMain.SelectedItem as InspectApply;
+            if (inspectApply == null) return;
+
+            var inspectionReport = _reportService.Get(x => x.InspectApplyGuid == inspectApply.Guid);
+
+            FactoryLicense factoryLicense = new FactoryLicense()
+            {
+                InspectApplyGuid = inspectApply.Guid,
+                InspectApply = inspectApply,
+                LicenseNo = inspectApply.ApplyNo.Replace("申请","许"),
+                //LicenseListNo = ,
+                FactoryDate = inspectionReport?.ReportTime ?? DateTime.Now,
+
+            };
+        }
+
+        [RelayCommand]
+        private void SaveFactoryLicence()
+        {
+
+        }
+
+        [RelayCommand]
+        private void ExportFactoryLicence()
+        {
+
+        }
+    }
+}

+ 8 - 1
UniformMaterialManagementSystem/ViewModels/SelectInspectApplyWindowViewModel.cs

@@ -66,7 +66,14 @@ namespace UniformMaterialManagementSystem.ViewModels
                         InspectApplies.Add(inspectApply);
                     }
                     break;
-                case ""://许可证
+                case "FactoryLicense"://许可证
+                    inspectApplyList = _inspectApplyService.Query(x => !x.LicenseStatus && x.ReportStatus)
+                        .Include(x => x.InspectApplyContractDetails)
+                        .Include(x => x.Material).ToList();
+                    foreach (var inspectApply in inspectApplyList)
+                    {
+                        InspectApplies.Add(inspectApply);
+                    }
                     break;
             }
             

+ 635 - 0
UniformMaterialManagementSystem/Views/FactoryLicensePage.xaml

@@ -0,0 +1,635 @@
+<UserControl
+    x:Class="UniformMaterialManagementSystem.Views.FactoryLicensePage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:behaviors="clr-namespace:UniformMaterialManagementSystem.Behaviors"
+    xmlns:control="http://FilterDataGrid.Control.com/2024"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:UniformMaterialManagementSystem.Views"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <UserControl.Resources>
+        <!--  定义一个全局的TextBlock样式  -->
+        <Style TargetType="TextBlock">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Margin" Value="5" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="RadioButton">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+        </Style>
+        <Style TargetType="ComboBox">
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="DatePicker">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="TextBox">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <ControlTemplate x:Key="CustomColumnHeaderTemplate" TargetType="DataGridColumnHeader">
+            <Border BorderBrush="LightSlateGray" BorderThickness="0,0,1,1">
+                <Grid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition />
+                        <ColumnDefinition Width="Auto" />
+                        <ColumnDefinition Width="Auto" />
+                    </Grid.ColumnDefinitions>
+                    <Border
+                        Grid.Column="0"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="0,0,0,1">
+                        <ContentPresenter
+                            Margin="5,0"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center" />
+                    </Border>
+                    <Path
+                        x:Name="SortArrow"
+                        Grid.Column="1"
+                        Margin="0,0,5,0"
+                        VerticalAlignment="Center"
+                        Data="M 0 0 L 10 0 L 5 5 Z"
+                        Fill="Gray"
+                        Visibility="Collapsed" />
+                    <Thumb
+                        x:Name="PART_RightHeaderGripper"
+                        Grid.Column="2"
+                        Width="1"
+                        Height="25"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="1"
+                        Cursor="SizeWE" />
+                </Grid>
+            </Border>
+            <ControlTemplate.Triggers>
+                <Trigger Property="SortDirection" Value="Ascending">
+                    <Setter TargetName="SortArrow" Property="Data" Value="M 0 5 L 10 5 L 5 0 Z" />
+                    <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
+                </Trigger>
+                <Trigger Property="SortDirection" Value="Descending">
+                    <Setter TargetName="SortArrow" Property="Data" Value="M 0 0 L 10 0 L 5 5 Z" />
+                    <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
+                </Trigger>
+            </ControlTemplate.Triggers>
+        </ControlTemplate>
+
+        <Style x:Key="CustomColumnHeaderStyle" TargetType="DataGridColumnHeader">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="Foreground" Value="Black" />
+            <Setter Property="FontWeight" Value="Bold" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Height" Value="40" />
+            <Setter Property="Template" Value="{StaticResource CustomColumnHeaderTemplate}" />
+        </Style>
+
+        <Style x:Key="CustomRowHeaderStyle" TargetType="DataGridRowHeader">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="Foreground" Value="Black" />
+            <Setter Property="BorderThickness" Value="0,0,1,1" />
+            <Setter Property="BorderBrush" Value="LightSlateGray" />
+        </Style>
+
+        <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="FontSize" Value="13" />
+            <Setter Property="Height" Value="26" />
+
+            <Style.Triggers>
+                <Trigger Property="AlternationIndex" Value="1">
+                    <Setter Property="Background" Value="WhiteSmoke" />
+                </Trigger>
+                <Trigger Property="IsSelected" Value="True">
+                    <Setter Property="Background" Value="LightBlue" />
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+        <Style
+            x:Key="CustomCellStyle"
+            BasedOn="{StaticResource {x:Type DataGridCell}}"
+            TargetType="DataGridCell">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Padding" Value="10" />
+            <Style.Triggers>
+                <Trigger Property="IsSelected" Value="True">
+                    <Setter Property="Background" Value="LightBlue" />
+                    <Setter Property="Foreground" Value="Black" />
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="Auto" />
+            <ColumnDefinition Width="2*" />
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="*" />
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0">
+                <!--  菜单项  -->
+                <Border
+                    Grid.Row="0"
+                    BorderBrush="Gray"
+                    BorderThickness="1">
+                    <Grid Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <StackPanel
+                            Grid.Column="0"
+                            FlowDirection="LeftToRight"
+                            Orientation="Horizontal" />
+                        <ToolBarPanel Grid.Column="1">
+                            <ToolBar Background="White" ToolBarTray.IsLocked="True">
+
+                                <Button Command="{Binding LoadDataCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="40"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Document_Search_16}" />
+                                                    <TextBlock Text="刷新" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+                                <Separator />
+                                <Button Command="{Binding AddFactoryLicenceCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="40"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Add_Circle_32}" />
+                                                    <TextBlock Text="新增" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+                                <Button Command="{Binding SaveFactoryLicenceCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="40"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Save_32}" />
+                                                    <TextBlock Text="保存" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+                                <Separator />
+                                <Button Command="{Binding ExportFactoryLicenceCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="60"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Dock_20}" />
+                                                    <TextBlock Text="导出许可证" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+
+                            </ToolBar>
+                        </ToolBarPanel>
+                    </Grid>
+                </Border>
+            </Grid>
+            <control:FilterDataGrid
+                x:Name="DataGridMain"
+                Grid.Row="1"
+                behaviors:DataGridBehavior.RowNumbers="True"
+                AutoGenerateColumns="False"
+                Background="White"
+                CanUserAddRows="False"
+                CanUserReorderColumns="True"
+                CellStyle="{StaticResource CustomCellStyle}"
+                ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                FilterLanguage="SimplifiedChinese"
+                HeadersVisibility="All"
+                HorizontalGridLinesBrush="LightSlateGray"
+                ItemsSource="{Binding FactoryLicenses, Mode=TwoWay}"
+                RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                RowStyle="{StaticResource CustomRowStyle}"
+                SelectedItem="{Binding SelectedFactoryLicense, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                SelectionMode="Single"
+                ShowRowsCount="True"
+                ShowStatusBar="True"
+                VerticalGridLinesBrush="LightSlateGray">
+
+                <control:FilterDataGrid.Resources>
+                    <!--  非编辑模式下文本居中的样式  -->
+                    <Style x:Key="TextColumnElementStyle" TargetType="TextBlock">
+                        <Setter Property="HorizontalAlignment" Value="Center" />
+                        <Setter Property="VerticalAlignment" Value="Center" />
+                        <Setter Property="TextAlignment" Value="Center" />
+                    </Style>
+
+                    <!--  编辑模式下文本居中的样式  -->
+                    <Style x:Key="TextColumnEditingElementStyle" TargetType="TextBox">
+                        <Setter Property="HorizontalAlignment" Value="Stretch" />
+                        <Setter Property="VerticalAlignment" Value="Stretch" />
+                        <Setter Property="VerticalContentAlignment" Value="Center" />
+                    </Style>
+
+                    <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
+                        <Setter Property="HorizontalAlignment" Value="Center" />
+                        <Setter Property="VerticalAlignment" Value="Center" />
+                        <Setter Property="IsEnabled" Value="False" />
+                    </Style>
+                </control:FilterDataGrid.Resources>
+
+                <control:FilterDataGrid.Columns>
+                    <DataGridTextColumn
+                        Width="60"
+                        Binding="{Binding InspectApply.Year}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="工作年度"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="300"
+                        Binding="{Binding LicenseNo}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="出厂许可证编号"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="150"
+                        Binding="{Binding LicenseListNo}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="许可证清单号"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="200"
+                        Binding="{Binding InspectApply.Company}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="生产企业"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="120"
+                        Binding="{Binding FactoryDate, StringFormat=yyyy-MM-dd}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="出厂日期"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="120"
+                        Binding="{Binding FactoryQuantity}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="出厂数量"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="100"
+                        Binding="{Binding EditUser}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="承办人"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+
+                </control:FilterDataGrid.Columns>
+            </control:FilterDataGrid>
+        </Grid>
+
+        <GridSplitter
+            Grid.Column="1"
+            Width="2"
+            HorizontalAlignment="Stretch" />
+        <Grid Grid.Column="2" Background="White">
+            <ScrollViewer>
+                <Grid Grid.Background="White">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="50" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="5*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="5*" />
+                        <ColumnDefinition Width="*" />
+                    </Grid.ColumnDefinitions>
+                    <TextBlock
+                        Grid.Row="0"
+                        Grid.Column="0"
+                        Grid.ColumnSpan="5"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        FontSize="25"
+                        Text="军需物资质量检验出厂许可证" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="许可证编号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.LicenseNo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="清单号:" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="3"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.LicenseListNo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="生产企业:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="1"
+                        Text="{Binding SelectedFactoryLicense.InspectApply.Company}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.RowSpan="3"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="合同号:"
+                        TextWrapping="Wrap" />
+                    <TextBox
+                        Grid.Row="2"
+                        Grid.RowSpan="3"
+                        Grid.Column="3"
+                        Height="120"
+                        IsReadOnly="True"
+                        Text="{Binding SelectedFactoryLicense.ContractNos}"
+                        VerticalScrollBarVisibility="Auto" />
+
+                    <TextBlock
+                        Grid.Row="3"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="产品名称:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="3"
+                        Grid.Column="1"
+                        Text="{Binding SelectedFactoryLicense.InspectApply.Material.Name}"
+                        TextWrapping="Wrap" />
+
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="产品规格:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="1"
+                        Text="{Binding SelectedFactoryLicense.InspectApply.Material.Specification}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="产品批号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="1"
+                        Text="{Binding SelectedFactoryLicense.InspectApply.BatchNo}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="生产日期:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="3"
+                        Text="{Binding SelectedFactoryLicense.ProductDate}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="第三方检验报告编号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="1"
+                        Text="{Binding SelectedFactoryLicense.InspectApply.InspReportNo}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="检验报告编号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="3"
+                        Text="{Binding SelectedFactoryLicense.InspectionReportNo}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="7"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*出厂数量:"
+                        TextWrapping="Wrap" />
+                    <WrapPanel
+                        Grid.Row="7"
+                        Grid.Column="1"
+                        VerticalAlignment="Center"
+                        FlowDirection="LeftToRight">
+                        <TextBox
+                            Width="120"
+                            VerticalAlignment="Center"
+                            Text="{Binding SelectedFactoryLicense.FactoryQuantity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextWrapping="Wrap" />
+                        <TextBlock VerticalAlignment="Center" Text="{Binding SelectedFactoryLicense.InspectApply.Material.MeasureUnit}" />
+                    </WrapPanel>
+                    <TextBlock
+                        Grid.Row="7"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*出厂日期:"
+                        TextWrapping="Wrap" />
+                    <DatePicker
+                        Grid.Row="7"
+                        Grid.Column="3"
+                        Text="{Binding SelectedFactoryLicense.FactoryDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                    <TextBlock
+                        Grid.Row="8"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*发证单位:"
+                        TextWrapping="Wrap" />
+                    <TextBox
+                        Grid.Row="8"
+                        Grid.Column="1"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.Department}" />
+                    <TextBlock
+                        Grid.Row="8"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*签发日期:"
+                        TextWrapping="Wrap" />
+                    <DatePicker
+                        Grid.Row="8"
+                        Grid.Column="3"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.SignDate}" />
+                    <TextBlock
+                        Grid.Row="9"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*承办人:"
+                        TextWrapping="Wrap" />
+                    <TextBox
+                        Grid.Row="9"
+                        Grid.Column="1"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.EditUser}" />
+                    <TextBlock
+                        Grid.Row="9"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*批准人:"
+                        TextWrapping="Wrap" />
+                    <TextBox
+                        Grid.Row="9"
+                        Grid.Column="3"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.ApproveUser}" />
+                    <TextBlock
+                        Grid.Row="10"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*审核人:"
+                        TextWrapping="Wrap" />
+                    <TextBox
+                        Grid.Row="10"
+                        Grid.Column="1"
+                        VerticalAlignment="Center"
+                        Text="{Binding SelectedFactoryLicense.AuditUser}" />
+
+
+
+                </Grid>
+            </ScrollViewer>
+        </Grid>
+    </Grid>
+</UserControl>

+ 19 - 0
UniformMaterialManagementSystem/Views/FactoryLicensePage.xaml.cs

@@ -0,0 +1,19 @@
+using Microsoft.Extensions.DependencyInjection;
+using System.Windows.Controls;
+using UniformMaterialManagementSystem.ViewModels;
+
+namespace UniformMaterialManagementSystem.Views
+{
+    /// <summary>
+    /// FactoryLicensePage.xaml 的交互逻辑
+    /// </summary>
+    public partial class FactoryLicensePage : UserControl
+    {
+        public FactoryLicensePage()
+        {
+            InitializeComponent();
+
+            this.DataContext = App.Current.Services.GetServices<FactoryLicensePageViewModel>();
+        }
+    }
+}