0626
parent
325a436ae3
commit
57f0699959
|
@ -40,19 +40,19 @@ public class CodePakageConfiguration : EntityTenant
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 条码前缀
|
/// 条码前缀
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "CodePrefix", ColumnDescription = "条码前缀", Length = 32)]
|
[SugarColumn(ColumnName = "CodePrefix", ColumnDescription = "条码前缀", Length = 64)]
|
||||||
public string? CodePrefix { get; set; }
|
public string? CodePrefix { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 内码前缀
|
/// 内码前缀
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "InternalCodePrefix", ColumnDescription = "内码前缀", Length = 32)]
|
[SugarColumn(ColumnName = "InternalCodePrefix", ColumnDescription = "内码前缀", Length = 64)]
|
||||||
public string? InternalCodePrefix { get; set; }
|
public string? InternalCodePrefix { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导出格式示例
|
/// 导出格式示例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "ExportFormatExample", ColumnDescription = "导出格式示例", Length = 32)]
|
[SugarColumn(ColumnName = "ExportFormatExample", ColumnDescription = "导出格式示例", Length = 64)]
|
||||||
public string? ExportFormatExample { get; set; }
|
public string? ExportFormatExample { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
namespace Admin.NET.Application.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("printrecords","打印记录")]
|
||||||
|
public class PrintRecords : EntityBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料ID
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "MaterialsId", ColumnDescription = "物料ID")]
|
||||||
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Batch", ColumnDescription = "批次", Length = 32)]
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ProductCount", ColumnDescription = "完工数量")]
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "BaseProductCount", ColumnDescription = "基本完工数量")]
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Unit", ColumnDescription = "单位", Length = 32)]
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产日期
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ProductDate", ColumnDescription = "生产日期")]
|
||||||
|
public DateTime? ProductDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失效日期
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "LoseDate", ColumnDescription = "失效日期")]
|
||||||
|
public DateTime? LoseDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
|
||||||
|
}
|
|
@ -165,4 +165,9 @@ public class ReportDetailTable : EntityTenant
|
||||||
[SugarColumn(ColumnName = "MaterialsId", ColumnDescription = "物料ID")]
|
[SugarColumn(ColumnName = "MaterialsId", ColumnDescription = "物料ID")]
|
||||||
public long? MaterialsId { get; set; }
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位组ID
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "UnitGroupId", ColumnDescription = "单位组ID")]
|
||||||
|
public long? UnitGroupId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,4 +67,34 @@ public class ReportTable : EntityTenant
|
||||||
[SugarColumn(ColumnName = "SourceId", ColumnDescription = "源单ID")]
|
[SugarColumn(ColumnName = "SourceId", ColumnDescription = "源单ID")]
|
||||||
public long? SourceId { get; set; }
|
public long? SourceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ProductCount", ColumnDescription = "完工数量")]
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "BaseProductCount", ColumnDescription = "基本完工数量")]
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Unit", ColumnDescription = "单位", Length = 32)]
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Batch", ColumnDescription = "批次", Length = 32)]
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class PrintrecordsDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料ID
|
||||||
|
/// </summary>
|
||||||
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ProductDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失效日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LoseDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,189 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录基础输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class PrintrecordsBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料ID
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产日期
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? ProductDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失效日期
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? LoseDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Remarks { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录分页查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class PrintRecordsInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字查询
|
||||||
|
/// </summary>
|
||||||
|
public string? SearchKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料ID
|
||||||
|
/// </summary>
|
||||||
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ProductDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失效日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LoseDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录增加输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class AddPrintRecordsInput : PrintrecordsBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "软删除不能为空")]
|
||||||
|
public override bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录删除输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class DeletePrintRecordsInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class UpdatePrintRecordsInput : PrintrecordsBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "主键Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录主键查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class QueryByIdPrintRecordsInput : DeletePrintRecordsInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class PrintRecordsOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料ID
|
||||||
|
/// </summary>
|
||||||
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ProductDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失效日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LoseDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
using Admin.NET.Core.Service;
|
||||||
|
using Admin.NET.Application.Const;
|
||||||
|
using Admin.NET.Application.Entity;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
/// <summary>
|
||||||
|
/// 打印记录服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 100)]
|
||||||
|
public class PrintRecordsService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<PrintRecords> _rep;
|
||||||
|
public PrintRecordsService(SqlSugarRepository<PrintRecords> rep)
|
||||||
|
{
|
||||||
|
_rep = rep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询打印记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Page")]
|
||||||
|
public async Task<SqlSugarPagedList<PrintRecordsOutput>> Page(PrintRecordsInput input)
|
||||||
|
{
|
||||||
|
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||||
|
u.Name.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Batch.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Unit.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Remarks.Contains(input.SearchKey.Trim())
|
||||||
|
)
|
||||||
|
.WhereIF(input.MaterialsId>0, u => u.MaterialsId == input.MaterialsId)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Batch), u => u.Batch.Contains(input.Batch.Trim()))
|
||||||
|
.WhereIF(input.ProductCount>0, u => u.ProductCount == input.ProductCount)
|
||||||
|
.WhereIF(input.BaseProductCount>0, u => u.BaseProductCount == input.BaseProductCount)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Unit), u => u.Unit.Contains(input.Unit.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
|
||||||
|
.Select<PrintRecordsOutput>();
|
||||||
|
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加打印记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Add")]
|
||||||
|
public async Task<long> Add(AddPrintRecordsInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<PrintRecords>();
|
||||||
|
await _rep.InsertAsync(entity);
|
||||||
|
return entity.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除打印记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Delete")]
|
||||||
|
public async Task Delete(DeletePrintRecordsInput input)
|
||||||
|
{
|
||||||
|
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
await _rep.FakeDeleteAsync(entity); //假删除
|
||||||
|
//await _rep.DeleteAsync(entity); //真删除
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新打印记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Update")]
|
||||||
|
public async Task Update(UpdatePrintRecordsInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<PrintRecords>();
|
||||||
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取打印记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "Detail")]
|
||||||
|
public async Task<PrintRecords> Detail([FromQuery] QueryByIdPrintRecordsInput input)
|
||||||
|
{
|
||||||
|
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取打印记录列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "List")]
|
||||||
|
public async Task<List<PrintRecordsOutput>> List()
|
||||||
|
{
|
||||||
|
return await _rep.AsQueryable().Select<PrintRecordsOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
using Admin.NET.Application.Const;
|
using Admin.NET.Application.Const;
|
||||||
using Admin.NET.Application.Entity;
|
using Admin.NET.Application.Entity;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.TCBGetPressureTestReportResponse.Types;
|
||||||
|
|
||||||
namespace Admin.NET.Application;
|
namespace Admin.NET.Application;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 商品追溯服务
|
/// 商品追溯服务
|
||||||
|
@ -11,11 +13,14 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
private readonly SqlSugarRepository<ProductRetrospect> _rep;
|
private readonly SqlSugarRepository<ProductRetrospect> _rep;
|
||||||
private readonly PrintCodeDetailService _codeDetailService;
|
private readonly PrintCodeDetailService _codeDetailService;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
public ProductRetrospectService(SqlSugarRepository<ProductRetrospect> rep,
|
public ProductRetrospectService(SqlSugarRepository<ProductRetrospect> rep,
|
||||||
PrintCodeDetailService codeDetailService)
|
PrintCodeDetailService codeDetailService,
|
||||||
|
UserManager userManager)
|
||||||
{
|
{
|
||||||
_rep = rep;
|
_rep = rep;
|
||||||
_codeDetailService = codeDetailService;
|
_codeDetailService = codeDetailService;
|
||||||
|
_userManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -30,6 +35,7 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
|
||||||
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
|
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||||
u.OddNumber.Contains(input.SearchKey.Trim())
|
u.OddNumber.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Code.Contains(input.SearchKey.Trim())
|
||||||
|| u.CodeType.Contains(input.SearchKey.Trim())
|
|| u.CodeType.Contains(input.SearchKey.Trim())
|
||||||
|| u.BusinessType.Contains(input.SearchKey.Trim())
|
|| u.BusinessType.Contains(input.SearchKey.Trim())
|
||||||
|| u.Destination.Contains(input.SearchKey.Trim())
|
|| u.Destination.Contains(input.SearchKey.Trim())
|
||||||
|
@ -42,6 +48,7 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
|
||||||
|| u.Remarks.Contains(input.SearchKey.Trim())
|
|| u.Remarks.Contains(input.SearchKey.Trim())
|
||||||
)
|
)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.OddNumber), u => u.OddNumber.Contains(input.OddNumber.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.OddNumber), u => u.OddNumber.Contains(input.OddNumber.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code.Trim()))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeType), u => u.CodeType.Contains(input.CodeType.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeType), u => u.CodeType.Contains(input.CodeType.Trim()))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.BusinessType), u => u.BusinessType.Contains(input.BusinessType.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BusinessType), u => u.BusinessType.Contains(input.BusinessType.Trim()))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Destination), u => u.Destination.Contains(input.Destination.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Destination), u => u.Destination.Contains(input.Destination.Trim()))
|
||||||
|
@ -156,6 +163,38 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
|
||||||
return await _rep.AsQueryable().Where(u => !u.IsDelete && u.Code == productCode).Select<ProductRetrospectOutput>().ToListAsync();
|
return await _rep.AsQueryable().Where(u => !u.IsDelete && u.Code == productCode).Select<ProductRetrospectOutput>().ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task AddRetrospect(PrintCodeDetail item ,ReportTable report,string receipt, string location ,long? sourceId)
|
||||||
|
{
|
||||||
|
var userId = _userManager.UserId;
|
||||||
|
var userName = _userManager.RealName;
|
||||||
|
var retrospect1 = new AddProductRetrospectInput()
|
||||||
|
{
|
||||||
|
BaseCount = item.BaseCount,
|
||||||
|
BaseUnit = item.BaseUnit,
|
||||||
|
Batch = report.Batch,
|
||||||
|
BusinessType = report.ProductType,
|
||||||
|
CodeType = item.CodeName,
|
||||||
|
Location = location,
|
||||||
|
Department = report.ProductionLine,
|
||||||
|
//WarehouseID = input.WarehouseId,
|
||||||
|
WarehousingDate = DateTime.Now,
|
||||||
|
Count = 1,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
ScanCodeTime = DateTime.Now,
|
||||||
|
CreateUserId = userId,
|
||||||
|
CreateUserName = userName,
|
||||||
|
MaterialsId = report.MaterialsId,
|
||||||
|
OddNumber = report.OddNumber,
|
||||||
|
Receipt = receipt,
|
||||||
|
SourceId = sourceId,
|
||||||
|
Unit = item.Unit,
|
||||||
|
Name = item.CodeName,
|
||||||
|
Code = item.Code,
|
||||||
|
//Destination = invoice.Consignee
|
||||||
|
};
|
||||||
|
await Add(retrospect1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,10 @@ public class ReportDetailTableDto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? MaterialsId { get; set; }
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位组ID
|
||||||
|
/// </summary>
|
||||||
|
public long? UnitGroupId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -133,6 +133,10 @@ public class ReportDetailTableBaseInput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual long? MaterialsId { get; set; }
|
public virtual long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位组ID
|
||||||
|
/// </summary>
|
||||||
|
public long? UnitGroupId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
|
|
|
@ -135,6 +135,10 @@ public class ReportDetailTableOutput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? MaterialsId { get; set; }
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位组ID
|
||||||
|
/// </summary>
|
||||||
|
public long? UnitGroupId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -17,10 +17,14 @@ public class AddReportContext
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long UnitGroupId { get; set; }
|
public long UnitGroupId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 码包名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 码包名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Package { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 生产日期
|
/// 生产日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? ProductDate { get; set; }
|
public DateTime? ProductDate { get; set; }
|
||||||
|
|
|
@ -55,6 +55,30 @@ public class ReportTableDto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? SourceId { get; set; }
|
public long? SourceId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Remarks { get; set; }
|
public string? Remarks { get; set; }
|
||||||
|
|
|
@ -53,6 +53,30 @@ public class ReportTableBaseInput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? MaterialsId { get; set; }
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -55,6 +55,31 @@ public class ReportTableOutput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? MaterialsId { get; set; }
|
public long? MaterialsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? ProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基本完工数量
|
||||||
|
/// </summary>
|
||||||
|
public int? BaseProductCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? Unit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -21,14 +21,17 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
//private readonly ReportDetailTableService _reportDetailTable;
|
//private readonly ReportDetailTableService _reportDetailTable;
|
||||||
private readonly UserManager _userManager;
|
private readonly UserManager _userManager;
|
||||||
private readonly PrintDataService _printDataService;
|
private readonly PrintDataService _printDataService;
|
||||||
|
private readonly PrintRecordsService _printRecordsService;
|
||||||
|
private readonly ProductRetrospectService _productRetrospectService;
|
||||||
public ReportTableService(SqlSugarRepository<ReportTable> rep,
|
public ReportTableService(SqlSugarRepository<ReportTable> rep,
|
||||||
UserManager userManager,
|
UserManager userManager,
|
||||||
SysUnitService repUnit,
|
SysUnitService repUnit,
|
||||||
SysUnitGroupService repUnitGroup,
|
SysUnitGroupService repUnitGroup,
|
||||||
PrintCodeDetailService codeDetailService,
|
PrintCodeDetailService codeDetailService,
|
||||||
//ReportDetailTableService reportDetailTable,
|
//ReportDetailTableService reportDetailTable,
|
||||||
PrintDataService printDataService)
|
PrintDataService printDataService,
|
||||||
|
PrintRecordsService printRecordsService,
|
||||||
|
ProductRetrospectService productRetrospectService)
|
||||||
{
|
{
|
||||||
_rep = rep;
|
_rep = rep;
|
||||||
_repUnit = repUnit;
|
_repUnit = repUnit;
|
||||||
|
@ -37,6 +40,8 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
//_reportDetailTable = reportDetailTable;
|
//_reportDetailTable = reportDetailTable;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_printDataService = printDataService;
|
_printDataService = printDataService;
|
||||||
|
_printRecordsService = printRecordsService;
|
||||||
|
_productRetrospectService = productRetrospectService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -92,7 +97,7 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
entity.SourceId = input.UpdateUserId;
|
entity.SourceId = input.UpdateUserId;
|
||||||
}
|
}
|
||||||
await _rep.InsertAsync(entity);
|
var reportId = await _rep.InsertAsync(entity);
|
||||||
|
|
||||||
if (input.UpdateUserId > 0)
|
if (input.UpdateUserId > 0)
|
||||||
{
|
{
|
||||||
|
@ -102,20 +107,25 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
|
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
|
||||||
if (printDetails.Count > 0)
|
if (printDetails.Count < 1)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
for (int i = 0; i < printDetails.Count; i++)
|
for (int i = 0; i < printDetails.Count; i++)
|
||||||
{
|
{
|
||||||
var item = printDetails[i];
|
var item = printDetails[i];
|
||||||
item.ReportTableId = entity.Id;
|
item.ReportTableId = entity.Id;
|
||||||
await _codeDetailService.Update(item.Adapt<UpdatePrintCodeDetailInput>());
|
var ent = item.Adapt<PrintCodeDetail>();
|
||||||
}
|
await _codeDetailService.UpdateByEntity(ent);
|
||||||
|
await _productRetrospectService.AddRetrospect(ent, entity, "汇报单", entity.ProductionLine, entity.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return entity.Id;
|
return entity.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除汇报单
|
/// 删除汇报单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -224,8 +234,8 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
|
|
||||||
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 1 };
|
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 1 };
|
||||||
var addReport = await Add(newReport);
|
var addReport = await Add(newReport);
|
||||||
var others = units.FindAll(a => a.Rate < unit.Rate);
|
|
||||||
|
|
||||||
|
var others = units.FindAll(a => a.Rate < unit.Rate);
|
||||||
|
|
||||||
var entity = input.Adapt<ReportTable>();
|
var entity = input.Adapt<ReportTable>();
|
||||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||||
|
@ -255,8 +265,9 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
if (unit == null)
|
if (unit == null)
|
||||||
throw new ArgumentNullException(nameof(unitGroup));
|
throw new ArgumentNullException(nameof(unitGroup));
|
||||||
|
|
||||||
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 0, MaterialsId = input.MaterialsId };
|
var newReport = new AddPrintRecordsInput() { CreateTime = DateTime.Now, Unit = input.Package, Name = input.Name, IsDelete = false, Batch = input.Batch, ProductDate = input.ProductDate, LoseDate = input.LoseDate, ProductCount = input.PrintDatas?.Count, MaterialsId = input.MaterialsId };
|
||||||
var addReport = await Add(newReport);
|
var addReport = await _printRecordsService.Add(newReport);
|
||||||
|
|
||||||
var others = units.FindAll(a => a.Rate < unit.Rate).OrderBy(a => a.Rate).ToList();
|
var others = units.FindAll(a => a.Rate < unit.Rate).OrderBy(a => a.Rate).ToList();
|
||||||
others.Reverse();
|
others.Reverse();
|
||||||
int toltalCount = unit.Rate.ToInt();
|
int toltalCount = unit.Rate.ToInt();
|
||||||
|
@ -267,7 +278,7 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
tempUnits.AddRange(others);
|
tempUnits.AddRange(others);
|
||||||
foreach (var item in input.PrintDatas)
|
foreach (var item in input.PrintDatas)
|
||||||
{
|
{
|
||||||
var code = CodeHelper.GetCode(item.BarCode, item.BarCode);
|
var code = CodeHelper.GetCode(item.BarCode, item.QrCode);
|
||||||
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||||
var detail = new AddPrintCodeDetailInput()
|
var detail = new AddPrintCodeDetailInput()
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ internal class CodeHelper
|
||||||
public static string GetCode(string? barCode, string? qrCode)
|
public static string GetCode(string? barCode, string? qrCode)
|
||||||
{
|
{
|
||||||
var code = string.IsNullOrEmpty(barCode) ? qrCode : barCode;
|
var code = string.IsNullOrEmpty(barCode) ? qrCode : barCode;
|
||||||
if (code.Contains("?code="))
|
if (!string.IsNullOrEmpty(code) && code.Contains("?code="))
|
||||||
{
|
{
|
||||||
code = code.Split('=').LastOrDefault();
|
code = code.Split('=').LastOrDefault();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
import request from '/@/utils/request';
|
||||||
|
enum Api {
|
||||||
|
AddPrintRecords = '/api/printRecords/add',
|
||||||
|
DeletePrintRecords = '/api/printRecords/delete',
|
||||||
|
UpdatePrintRecords = '/api/printRecords/update',
|
||||||
|
PagePrintRecords = '/api/printRecords/page',
|
||||||
|
DetailPrintRecords = '/api/printRecords/detail',
|
||||||
|
ListPrintRecords = '/api/printRecords/list',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 增加打印记录
|
||||||
|
export const addPrintRecords = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.AddPrintRecords,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 删除打印记录
|
||||||
|
export const deletePrintRecords = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.DeletePrintRecords,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 编辑打印记录
|
||||||
|
export const updatePrintRecords = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.UpdatePrintRecords,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 分页查询打印记录
|
||||||
|
export const pagePrintRecords = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.PagePrintRecords,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 详情打印记录
|
||||||
|
export const detailPrintRecords = (id: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.DetailPrintRecords,
|
||||||
|
method: 'get',
|
||||||
|
data: { id },
|
||||||
|
});
|
||||||
|
|
||||||
|
// 列表打印记录
|
||||||
|
export const listPrintRecords = () =>
|
||||||
|
request({
|
||||||
|
url: Api.ListPrintRecords,
|
||||||
|
method: 'get',
|
||||||
|
data: { },
|
||||||
|
});
|
||||||
|
|
|
@ -59,7 +59,6 @@ export function formatDate(date: Date, format: string): string {
|
||||||
const hours = now.getHours().toString().padStart(2, '0');
|
const hours = now.getHours().toString().padStart(2, '0');
|
||||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||||
|
|
||||||
return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<el-switch v-model="ruleForm.isEnable" inline-prompt active-text="启用" inactive-text="禁用" />
|
<el-switch v-model="ruleForm.isEnable" inline-prompt active-text="启用" inactive-text="禁用" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" :key="key">
|
<el-tabs v-model="activeName" class="demo-tabs" :key="key">
|
||||||
<el-tab-pane label="基本信息" name="基本信息">
|
<el-tab-pane label="基本信息" name="基本信息">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -265,11 +265,6 @@ onMounted(() => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
|
||||||
console.log('submit!')
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取品牌数据
|
//获取品牌数据
|
||||||
let brandDate = ref([] as BrandOutput[]);
|
let brandDate = ref([] as BrandOutput[]);
|
||||||
|
|
||||||
|
@ -312,14 +307,15 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
|
||||||
//提交
|
//提交
|
||||||
const matterSubmit = async () => {
|
const matterSubmit = async () => {
|
||||||
let res;
|
let res;
|
||||||
//console.log(ruleForm);
|
|
||||||
if (props.title=='添加物料'){
|
if (props.title=='添加物料'){
|
||||||
res = await addMaterials(ruleForm.value);
|
res = await addMaterials(ruleForm.value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res = await updateMaterials(ruleForm.value);
|
res = await updateMaterials(ruleForm.value);
|
||||||
}
|
}
|
||||||
if (res.code === 200) {
|
//console.log(res)
|
||||||
|
|
||||||
|
if (res.data.code == 200) {
|
||||||
state.isShowDialog = false;
|
state.isShowDialog = false;
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '成功',
|
message: '成功',
|
||||||
|
@ -329,35 +325,34 @@ const matterSubmit = async () => {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ElMessage.error(res.message!)
|
ElMessage.error(res.message!)
|
||||||
//MaterialsPage({})
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取包装关系
|
// //获取包装关系
|
||||||
let infoDate = reactive([] as PackageInfoOutput[])
|
let infoDate = reactive([] as PackageInfoOutput[])
|
||||||
const getPackageInfoApi = async (id: number) => {
|
// const getPackageInfoApi = async (id: number) => {
|
||||||
let res = await getAPI(PackageInfoApi).apiPackageInfoListMaterialsIdGet(id);
|
// let res = await getAPI(PackageInfoApi).apiPackageInfoListMaterialsIdGet(id);
|
||||||
if (res.data.code === 200) {
|
// if (res.data.code === 200) {
|
||||||
infoDate = res.data.result!;
|
// infoDate = res.data.result!;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//批量更新包装关系
|
// //批量更新包装关系
|
||||||
const UpdateInfoApi = async (paramsList: any[]) => {
|
// const UpdateInfoApi = async (paramsList: any[]) => {
|
||||||
const requests = paramsList.map(params => getAPI(PackageInfoApi).apiPackageInfoUpdatePost(params));
|
// const requests = paramsList.map(params => getAPI(PackageInfoApi).apiPackageInfoUpdatePost(params));
|
||||||
|
|
||||||
// 使用 Promise.all 等待所有请求完成
|
// // 使用 Promise.all 等待所有请求完成
|
||||||
Promise.all(requests)
|
// Promise.all(requests)
|
||||||
.then(responses => {
|
// .then(responses => {
|
||||||
// 所有请求都已完成,responses 是一个包含所有响应的数组
|
// // 所有请求都已完成,responses 是一个包含所有响应的数组
|
||||||
console.log('所有请求完成:', responses);
|
// console.log('所有请求完成:', responses);
|
||||||
})
|
// })
|
||||||
.catch(error => {
|
// .catch(error => {
|
||||||
// 如果任何一个请求失败,则会进入这里
|
// // 如果任何一个请求失败,则会进入这里
|
||||||
console.error('请求失败:', error);
|
// console.error('请求失败:', error);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -119,7 +119,7 @@ const printInfoFrom = reactive({
|
||||||
package: '',
|
package: '',
|
||||||
productDate: undefined,
|
productDate: undefined,
|
||||||
loseDate: undefined,
|
loseDate: undefined,
|
||||||
batch:1,
|
batch:'',
|
||||||
})
|
})
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
@ -188,7 +188,7 @@ const printSubmit = async () => {
|
||||||
callback: async () => {
|
callback: async () => {
|
||||||
state.waitShowPrinter = false;
|
state.waitShowPrinter = false;
|
||||||
console.log('1111111');
|
console.log('1111111');
|
||||||
let contexts={unitGroupId:state.matterFrom.unitGroupId, materialsId:state.matterFrom.id, name:printInfoFrom.package, productDate:printInfoFrom.productDate, loseDate:printInfoFrom.loseDate, batch:printInfoFrom.batch, printDatas:printData.value};
|
let contexts={unitGroupId:state.matterFrom.unitGroupId, materialsId:state.matterFrom.id, name:state.matterFrom.name, package:printInfoFrom.package, productDate:printInfoFrom.productDate, loseDate:printInfoFrom.loseDate, batch:printInfoFrom.batch, printDatas:printData.value};
|
||||||
let details = await addPrintDetail(contexts);
|
let details = await addPrintDetail(contexts);
|
||||||
//console.log(details.data.result);
|
//console.log(details.data.result);
|
||||||
editDialogRef.value.openDialog(details.data.result);
|
editDialogRef.value.openDialog(details.data.result);
|
||||||
|
@ -205,17 +205,6 @@ const printSubmit = async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//添加汇报单
|
|
||||||
const addReport=async ()=>{
|
|
||||||
let reportData = {
|
|
||||||
unitGroupId:state.matterFrom.unitGroupId,
|
|
||||||
name:printInfoFrom.package,
|
|
||||||
printData:printData.value
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询操作
|
// 查询操作
|
||||||
|
|
|
@ -83,13 +83,16 @@
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
border="">
|
border="">
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||||
|
<el-table-column prop="name" label="名称" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="productDate" label="业务日期" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
|
|
||||||
|
<!-- <el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
|
||||||
|
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" /> -->
|
||||||
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column label="操作" width="240" align="center" fixed="right" show-overflow-tooltip="" >
|
<el-table-column label="操作" width="240" align="center" fixed="right" show-overflow-tooltip="" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -129,9 +132,9 @@
|
||||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||||
import { formatDate } from '/@/utils/formatTime';
|
import { formatDate } from '/@/utils/formatTime';
|
||||||
|
|
||||||
import addReportDialog from '/@/views/productionCenter/reportDetailTable/component/editDialog.vue'
|
import addReportDialog from '/@/views/productionCenter/reportTable/component/editDialog.vue'
|
||||||
import editDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
|
import editDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
|
||||||
import { pageReportTable, deleteReportTable } from '/@/api/main/reportTable';
|
import { pagePrintRecords, deletePrintRecords } from '/@/api/main/printRecords';
|
||||||
|
|
||||||
|
|
||||||
const showAdvanceQueryUI = ref(false);
|
const showAdvanceQueryUI = ref(false);
|
||||||
|
@ -158,7 +161,7 @@
|
||||||
// 查询操作
|
// 查询操作
|
||||||
const handleQuery = async () => {
|
const handleQuery = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
var res = await pageReportTable(Object.assign(queryParams.value, tableParams.value));
|
var res = await pagePrintRecords(Object.assign(queryParams.value, tableParams.value));
|
||||||
tableData.value = res.data.result?.items ?? [];
|
tableData.value = res.data.result?.items ?? [];
|
||||||
tableParams.value.total = res.data.result?.total;
|
tableParams.value.total = res.data.result?.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
@ -180,7 +183,12 @@
|
||||||
// 打开新增汇报单页面
|
// 打开新增汇报单页面
|
||||||
const addReportTable = (row: any) => {
|
const addReportTable = (row: any) => {
|
||||||
addReportTitle.value = '添加汇报单';
|
addReportTitle.value = '添加汇报单';
|
||||||
addReportDialogRef.value.openDialog({updateUserId:row.id});
|
let report = Object.assign({updateUserId:row.id},row);
|
||||||
|
report.updateUserId = row.id;
|
||||||
|
report.sourceId=row.id;
|
||||||
|
report.id = undefined;
|
||||||
|
//console.log(report);
|
||||||
|
addReportDialogRef.value.openDialog(report);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开打印详情页面
|
// 打开打印详情页面
|
||||||
|
@ -197,7 +205,7 @@
|
||||||
type: "warning",
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await deleteReportTable(row);
|
await deletePrintRecords(row);
|
||||||
handleQuery();
|
handleQuery();
|
||||||
ElMessage.success("删除成功");
|
ElMessage.success("删除成功");
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,64 +9,77 @@
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
|
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
|
||||||
<el-row :gutter="35">
|
<el-row :gutter="35">
|
||||||
<el-form-item v-show="false">
|
<!-- <el-form-item v-show="false">
|
||||||
<el-input v-model="ruleForm.id" />
|
<el-input v-model="ruleForm.id" />
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="ruleForm.name" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="单号" prop="oddNumber">
|
<el-form-item label="单号" prop="oddNumber">
|
||||||
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="数量" prop="productCount">
|
||||||
|
<el-input-number v-model="ruleForm.productCount" placeholder="请输入数量" maxlength="32" show-word-limit clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="单位" prop="unit" >
|
||||||
|
<el-input v-model="ruleForm.unit" placeholder="请输入单位" maxlength="32" show-word-limit clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="生产类型" prop="productType">
|
||||||
|
<el-select v-model="ruleForm.productType" placeholder="请选择" clearable>
|
||||||
|
<el-option label="普通生产" value= '普通生产' />
|
||||||
|
<el-option label="返工生产" value= '返工生产' />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="业务日期" prop="startDate">
|
<el-form-item label="业务日期" prop="startDate">
|
||||||
<el-date-picker v-model="ruleForm.startDate" type="date" placeholder="业务日期" />
|
<el-date-picker v-model="ruleForm.startDate" type="date" placeholder="业务日期" />
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
||||||
<el-form-item label="状态" prop="state">
|
|
||||||
<el-input-number v-model="ruleForm.state" placeholder="请输入状态" clearable />
|
|
||||||
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-col>
|
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
||||||
<el-form-item label="生产类型" prop="productType">
|
|
||||||
<el-input v-model="ruleForm.productType" placeholder="请输入生产类型" maxlength="32" show-word-limit clearable />
|
|
||||||
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-col>
|
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="生产线" prop="productionLine" >
|
<el-form-item label="生产线" prop="productionLine" >
|
||||||
<el-input v-model="ruleForm.productionLine" placeholder="请输入生产线" maxlength="32" show-word-limit clearable />
|
<el-select v-model="ruleForm.productionLine" placeholder="请选择" clearable >
|
||||||
|
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
|
||||||
|
:key="index" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
||||||
<el-form-item label="生产线编码" prop="codeNum">
|
|
||||||
<el-input v-model="ruleForm.codeNum" placeholder="请输入生产线编码" maxlength="32" show-word-limit clearable />
|
|
||||||
|
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="批次" prop="batch">
|
||||||
|
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
||||||
|
|
||||||
|
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="源单号" prop="sourceNumber">
|
<el-form-item label="源单号" prop="sourceNumber">
|
||||||
<el-input v-model="ruleForm.sourceNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
|
<el-input v-model="ruleForm.sourceNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
|
||||||
</el-col>
|
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="备注" prop="remarks">
|
<el-form-item label="备注" prop="remarks">
|
||||||
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" show-word-limit clearable />
|
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" show-word-limit clearable />
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -91,6 +104,9 @@
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import type { FormRules } from "element-plus";
|
import type { FormRules } from "element-plus";
|
||||||
import { addReportTable, updateReportTable, detailReportTable } from "/@/api/main/reportTable";
|
import { addReportTable, updateReportTable, detailReportTable } from "/@/api/main/reportTable";
|
||||||
|
import { listMaterials, detailMaterials } from '/@/api/main/materials';
|
||||||
|
import { listProductionLine } from '/@/api/main/productionLine';
|
||||||
|
import { getCurrentDate } from '/@/utils/formatTime';
|
||||||
|
|
||||||
//父级传递来的参数
|
//父级传递来的参数
|
||||||
var props = defineProps({
|
var props = defineProps({
|
||||||
|
@ -104,9 +120,11 @@
|
||||||
const ruleFormRef = ref();
|
const ruleFormRef = ref();
|
||||||
const isShowDialog = ref(false);
|
const isShowDialog = ref(false);
|
||||||
const ruleForm = ref<any>({});
|
const ruleForm = ref<any>({});
|
||||||
|
const currentMaterial = ref<any>({});
|
||||||
//自行添加其他规则
|
//自行添加其他规则
|
||||||
const rules = ref<FormRules>({
|
const rules = ref<FormRules>({
|
||||||
});
|
});
|
||||||
|
const productionLines = ref<any>([]);
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = async (row: any) => {
|
const openDialog = async (row: any) => {
|
||||||
|
@ -117,6 +135,16 @@
|
||||||
ruleForm.value = (await detailReportTable(rowData.id)).data.result;
|
ruleForm.value = (await detailReportTable(rowData.id)).data.result;
|
||||||
else
|
else
|
||||||
ruleForm.value = rowData;
|
ruleForm.value = rowData;
|
||||||
|
|
||||||
|
//console.log(rowData);
|
||||||
|
if(rowData.updateUserId){
|
||||||
|
currentMaterial.value= (await detailMaterials(rowData.materialsId)).data.result;
|
||||||
|
ruleForm.value.name=currentMaterial.value.name;
|
||||||
|
ruleForm.value.productType='普通生产';
|
||||||
|
ruleForm.value.startDate = ruleForm.value.productDate;
|
||||||
|
ruleForm.value.oddNumber = getCurrentDate();
|
||||||
|
//console.log(currentMaterial.value);
|
||||||
|
}
|
||||||
isShowDialog.value = true;
|
isShowDialog.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -159,6 +187,7 @@
|
||||||
|
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
productionLines.value = (await listProductionLine()).data.result;
|
||||||
});
|
});
|
||||||
|
|
||||||
//将属性或者函数暴露给父组件
|
//将属性或者函数暴露给父组件
|
||||||
|
|
|
@ -79,13 +79,16 @@
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
border="">
|
border="">
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||||
|
<el-table-column prop="name" label="名称" width="140" show-overflow-tooltip="" />
|
||||||
|
<el-table-column prop="unit" label="单位" width="100" show-overflow-tooltip="" />
|
||||||
|
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="startDate" label="业务日期" width="200" show-overflow-tooltip="" />
|
<el-table-column prop="startDate" label="业务日期" width="200" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="state" label="状态" width="80" show-overflow-tooltip="" />
|
<!-- <el-table-column prop="state" label="状态" width="80" show-overflow-tooltip="" /> -->
|
||||||
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="productCount" label="生产数量" width="100" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" />
|
<!-- <el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" /> -->
|
||||||
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportTable:update') || auth('reportTable:delete')">
|
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportTable:update') || auth('reportTable:delete')">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|
Loading…
Reference in New Issue