0624
parent
c358a67e4c
commit
325a436ae3
|
@ -4,7 +4,7 @@ namespace Admin.NET.Application.Entity;
|
|||
/// <summary>
|
||||
/// 防伪扫码记录
|
||||
/// </summary>
|
||||
[SugarTable("AntiFakeRecords","防伪扫码记录")]
|
||||
[SugarTable("antifakerecords","防伪扫码记录")]
|
||||
public class AntiFakeRecords : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -55,4 +55,29 @@ public class AntiFakeRecords : EntityBaseId
|
|||
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "InternalCode", ColumnDescription = "内码", Length = 32)]
|
||||
public string? InternalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CodeNum", ColumnDescription = "商品编码", Length = 32)]
|
||||
public string? CodeNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证通过
|
||||
/// </summary>
|
||||
[Required]
|
||||
[SugarColumn(ColumnName = "IsPass", ColumnDescription = "验证通过")]
|
||||
public bool IsPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "LongitudeAndLatitude", ColumnDescription = "经纬度", Length = 32)]
|
||||
public string? LongitudeAndLatitude { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Admin.NET.Application.Entity;
|
|||
/// <summary>
|
||||
/// 码元素
|
||||
/// </summary>
|
||||
[SugarTable("CodeElement","码元素")]
|
||||
[SugarTable("codeelement","码元素")]
|
||||
public class CodeElement : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -26,4 +26,10 @@ public class CodeElement : EntityBase
|
|||
[SugarColumn(ColumnName = "ExportFormatExample", ColumnDescription = "导出格式示例", Length = 32)]
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "UnitGroupId", ColumnDescription = "单位组")]
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Admin.NET.Application.Entity;
|
|||
/// <summary>
|
||||
/// 码包配置
|
||||
/// </summary>
|
||||
[SugarTable("CodePakageConfiguration","码包配置")]
|
||||
[SugarTable("codepakageconfiguration","码包配置")]
|
||||
public class CodePakageConfiguration : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -34,7 +34,7 @@ public class CodePakageConfiguration : EntityTenant
|
|||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ExportFormat", ColumnDescription = "导出格式")]
|
||||
[SugarColumn(ColumnName = "ExportFormat", ColumnDescription = "导出格式", Length = 255)]
|
||||
public string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -68,4 +68,10 @@ public class CodePakageConfiguration : EntityTenant
|
|||
[SugarColumn(ColumnName = "SuffixType", ColumnDescription = "后缀类型", Length = 32)]
|
||||
public string? SuffixType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "UnitGroupId", ColumnDescription = "单位组")]
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -128,6 +128,21 @@ public class AntiFakeRecordsService : IDynamicApiController, ITransient
|
|||
return await _rep.AsQueryable().Select<AntiFakeRecordsOutput>().ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取防伪扫码记录列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "Test")]
|
||||
public async Task Test()
|
||||
{
|
||||
var list = await _printCodeDetailService.List();
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.MaterialsId = 34150613270533;
|
||||
await _printCodeDetailService.UpdateByEntity(item.Adapt<PrintCodeDetail>());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取防伪扫码记录列表
|
||||
|
@ -142,6 +157,25 @@ public class AntiFakeRecordsService : IDynamicApiController, ITransient
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取防伪扫码记录列表
|
||||
/// </summary>
|
||||
/// <param name="productCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "CheckCode")]
|
||||
[AllowAnonymous]
|
||||
public async Task<bool> CheckCode(string productCode)
|
||||
{
|
||||
var code = await _printCodeDetailService.GetByProductCode(productCode);
|
||||
if (code == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取打印条码详情
|
||||
/// </summary>
|
||||
|
@ -149,30 +183,40 @@ public class AntiFakeRecordsService : IDynamicApiController, ITransient
|
|||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "AntiFakeCode")]
|
||||
[AllowAnonymous]
|
||||
public async Task<AntiFakeInfoOutput> AntiFakeCode(AddAntiFakeRecordsInput input)
|
||||
{
|
||||
var code = await _printCodeDetailService.GetByProductCode(input.Code);
|
||||
input.Date = DateTime.Now;
|
||||
if (code == null)
|
||||
{
|
||||
input.IsPass = false;
|
||||
await Add(input);
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var material = await _materialsService.GetById(code.MaterialsId);
|
||||
if (material == null)
|
||||
{
|
||||
input.IsPass = false;
|
||||
await Add(input);
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
input.IsPass = true;
|
||||
var model = new AntiFakeInfoOutput()
|
||||
{
|
||||
Addr = input.Addr,
|
||||
Code = code.Code,
|
||||
Name=material.Name,
|
||||
Brand = material.Brand,
|
||||
Specifications = material.Specifications,
|
||||
};
|
||||
var report = await _reportDetailTableService.Detail(new QueryByIdReportDetailTableInput() { Id = code.ReportTableId.Value });
|
||||
if (report!=null)
|
||||
{
|
||||
model.Batch= report.Batch;
|
||||
model.Batch= report.Batch;
|
||||
model.ProductionLine = report.ProductionLine;
|
||||
}
|
||||
await Add(input);
|
||||
return model;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,53 +1,74 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录输出参数
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 防伪扫码记录输出参数
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public string? Pro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public string? Pro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 内码
|
||||
/// </summary>
|
||||
public string? InternalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
public string? CodeNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证通过
|
||||
/// </summary>
|
||||
public bool IsPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度
|
||||
/// </summary>
|
||||
public string? LongitudeAndLatitude { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -3,140 +3,179 @@ using System.ComponentModel.DataAnnotations;
|
|||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录基础输入参数
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 防伪扫码记录基础输入参数
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public virtual string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public virtual string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public virtual string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public virtual string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public virtual string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public virtual string? Pro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public virtual DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
public virtual string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录分页查询输入参数
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public string? Pro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间范围
|
||||
/// </summary>
|
||||
public List<DateTime?> DateRange { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
public virtual string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录增加输入参数
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public class AddAntiFakeRecordsInput : AntiFakeRecordsBaseInput
|
||||
{
|
||||
}
|
||||
public virtual string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录删除输入参数
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public class DeleteAntiFakeRecordsInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
public virtual string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录更新输入参数
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public class UpdateAntiFakeRecordsInput : AntiFakeRecordsBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
public virtual string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录主键查询输入参数
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public class QueryByIdAntiFakeRecordsInput : DeleteAntiFakeRecordsInput
|
||||
{
|
||||
public virtual string? Pro { get; set; }
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public virtual DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码
|
||||
/// </summary>
|
||||
public string? InternalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
public string? CodeNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证通过
|
||||
/// </summary>
|
||||
public bool IsPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度
|
||||
/// </summary>
|
||||
public string? LongitudeAndLatitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录分页查询输入参数
|
||||
/// </summary>
|
||||
public class AntiFakeRecordsInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码
|
||||
/// </summary>
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地域信息
|
||||
/// </summary>
|
||||
public string? Addr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市编码
|
||||
/// </summary>
|
||||
public string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public string? Pro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扫码时间
|
||||
/// </summary>
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码
|
||||
/// </summary>
|
||||
public string? InternalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
public string? CodeNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证通过
|
||||
/// </summary>
|
||||
public bool IsPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度
|
||||
/// </summary>
|
||||
public string? LongitudeAndLatitude { get; set; }
|
||||
/// <summary>
|
||||
/// 扫码时间范围
|
||||
/// </summary>
|
||||
public List<DateTime?> DateRange { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录增加输入参数
|
||||
/// </summary>
|
||||
public class AddAntiFakeRecordsInput : AntiFakeRecordsBaseInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录删除输入参数
|
||||
/// </summary>
|
||||
public class DeleteAntiFakeRecordsInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录更新输入参数
|
||||
/// </summary>
|
||||
public class UpdateAntiFakeRecordsInput : AntiFakeRecordsBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防伪扫码记录主键查询输入参数
|
||||
/// </summary>
|
||||
public class QueryByIdAntiFakeRecordsInput : DeleteAntiFakeRecordsInput
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -45,6 +45,26 @@ public class AntiFakeRecordsOutput
|
|||
/// </summary>
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码
|
||||
/// </summary>
|
||||
public string? InternalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
public string? CodeNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证通过
|
||||
/// </summary>
|
||||
public bool IsPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度
|
||||
/// </summary>
|
||||
public string? LongitudeAndLatitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
|
|
@ -97,15 +97,14 @@ public class CodeElementService : IDynamicApiController, ITransient
|
|||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "ElementByName")]
|
||||
public async Task<CodeElement> GetElementByName([FromQuery] string input)
|
||||
public async Task<CodeElement> GetElementByName([FromQuery] string input,long? unitGroupId)
|
||||
{
|
||||
return await _rep.GetFirstAsync(u => u.CodeName == input);
|
||||
return await _rep.GetFirstAsync(u => u.UnitGroupId == unitGroupId && u.CodeName == input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取码元素列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "List")]
|
||||
|
@ -114,7 +113,17 @@ public class CodeElementService : IDynamicApiController, ITransient
|
|||
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<CodeElementOutput>().ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取码包配置列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "ListByGroupId")]
|
||||
public async Task<List<CodeElementOutput>> ListByGroupId(long? unitGroupId)
|
||||
{
|
||||
var list = await _rep.AsQueryable().Where(a => a.UnitGroupId == unitGroupId && !a.IsDelete).Select<CodeElementOutput>().ToListAsync();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,63 +1,69 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 码元素输出参数
|
||||
/// </summary>
|
||||
public class CodeElementDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 码元素输出参数
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public class CodeElementDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码长度
|
||||
/// </summary>
|
||||
public int CodeLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包名称
|
||||
/// </summary>
|
||||
public string? CodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { 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; }
|
||||
|
||||
}
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码长度
|
||||
/// </summary>
|
||||
public int CodeLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包名称
|
||||
/// </summary>
|
||||
public string? CodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { 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; }
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,11 @@ public class CodeElementBaseInput
|
|||
/// </summary>
|
||||
public virtual string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
|
@ -86,6 +91,10 @@ public class CodeElementInput : BasePageInput
|
|||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -9,57 +9,62 @@ public class CodeElementOutput
|
|||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 码长度
|
||||
/// </summary>
|
||||
public int CodeLength { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 码包名称
|
||||
/// </summary>
|
||||
public string? CodeName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { 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; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,6 +98,29 @@ public class CodePakageConfigurationService : IDynamicApiController, ITransient
|
|||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取码包配置列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "ListByGroupId")]
|
||||
public async Task<List<CodePakageConfigurationOutput>> ListByGroupId(long? unitGroupId)
|
||||
{
|
||||
var list = await _rep.AsQueryable().Where(a =>a.UnitGroupId == unitGroupId && !a.IsDelete).Select<CodePakageConfigurationOutput>().ToListAsync();
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取码元素
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "GetConfigByName")]
|
||||
public async Task<CodePakageConfiguration> GetConfigByName([FromQuery] string input, long? unitGroupId)
|
||||
{
|
||||
return await _rep.GetFirstAsync(u => u.UnitGroupId == unitGroupId && u.Name == input);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取码包示例
|
||||
/// </summary>
|
||||
|
|
|
@ -1,93 +1,98 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置输出参数
|
||||
/// </summary>
|
||||
public class CodePakageConfigurationDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 码包配置输出参数
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public class CodePakageConfigurationDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
public long? TenantId { 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; }
|
||||
|
||||
}
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
public long? TenantId { 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; }
|
||||
|
||||
}
|
||||
|
|
|
@ -3,50 +3,55 @@ using System.ComponentModel.DataAnnotations;
|
|||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置基础输入参数
|
||||
/// </summary>
|
||||
public class CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 码包配置基础输入参数
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public class CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public virtual int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public virtual string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public virtual string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public virtual long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public virtual string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public virtual string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public virtual string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public virtual string? ExportFormatExample { get; set; }
|
||||
public virtual int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public virtual string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public virtual string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public virtual long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public virtual string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public virtual string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public virtual string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public virtual string? ExportFormatExample { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码长度
|
||||
|
@ -62,93 +67,93 @@ namespace Admin.NET.Application;
|
|||
/// 租户Id
|
||||
/// </summary>
|
||||
public virtual long? TenantId { 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 CodePakageConfigurationInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
public virtual DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { 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 CodePakageConfigurationInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int? Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public string? CodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型ID
|
||||
/// </summary>
|
||||
public long? CodeTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式
|
||||
/// </summary>
|
||||
public string? ExportFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码前缀
|
||||
/// </summary>
|
||||
public string? CodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内码前缀
|
||||
/// </summary>
|
||||
public string? InternalCodePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出格式示例
|
||||
/// </summary>
|
||||
public string? ExportFormatExample { get; set; }
|
||||
/// <summary>
|
||||
/// 条码长度
|
||||
/// </summary>
|
||||
|
@ -161,43 +166,43 @@ namespace Admin.NET.Application;
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置增加输入参数
|
||||
/// </summary>
|
||||
public class AddCodePakageConfigurationInput : CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 码包配置增加输入参数
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public class AddCodePakageConfigurationInput : CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "软删除不能为空")]
|
||||
public override bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
[Required(ErrorMessage = "软删除不能为空")]
|
||||
public override bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置删除输入参数
|
||||
/// </summary>
|
||||
public class DeleteCodePakageConfigurationInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置更新输入参数
|
||||
/// </summary>
|
||||
public class UpdateCodePakageConfigurationInput : CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 码包配置删除输入参数
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public class DeleteCodePakageConfigurationInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置更新输入参数
|
||||
/// </summary>
|
||||
public class UpdateCodePakageConfigurationInput : CodePakageConfigurationBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 码包配置主键查询输入参数
|
||||
/// </summary>
|
||||
public class QueryByIdCodePakageConfigurationInput : DeleteCodePakageConfigurationInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 码包配置主键查询输入参数
|
||||
/// </summary>
|
||||
public class QueryByIdCodePakageConfigurationInput : DeleteCodePakageConfigurationInput
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,11 @@ public class CodePakageConfigurationOutput
|
|||
/// </summary>
|
||||
public virtual string? SuffixType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
|
|
|
@ -29,7 +29,11 @@ public class PrintDataMaterialsInput
|
|||
/// 码类型
|
||||
/// </summary>
|
||||
public string? CodeType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单位组
|
||||
/// </summary>
|
||||
public long? UnitGroupId { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
|
|
@ -14,13 +14,16 @@ public class PrintDataService : IDynamicApiController, ITransient
|
|||
private readonly SqlSugarRepository<PrintData> _rep;
|
||||
private readonly CodeElementService _codeElementService;
|
||||
private readonly CodeElementPropService _codeElementPropService;
|
||||
private readonly CodePakageConfigurationService _codePakageConfigurationService;
|
||||
public PrintDataService(SqlSugarRepository<PrintData> rep,
|
||||
CodeElementService codeElementService,
|
||||
CodeElementPropService codeElementPropService)
|
||||
CodeElementPropService codeElementPropService,
|
||||
CodePakageConfigurationService codePakageConfigurationService)
|
||||
{
|
||||
_rep = rep;
|
||||
_codeElementService = codeElementService;
|
||||
_codeElementPropService = codeElementPropService;
|
||||
_codePakageConfigurationService = codePakageConfigurationService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -107,26 +110,30 @@ public class PrintDataService : IDynamicApiController, ITransient
|
|||
[ApiDescriptionSettings(Name = "GetPrintDataList")]
|
||||
public async Task<List<PrintData>> GetPrintDataList(PrintDataMaterialsInput input)
|
||||
{
|
||||
return await GetPrintDatas(input.CodeHead, input.CodeType, input.Count);
|
||||
return await GetPrintDatas(input.UnitGroupId, input.CodeHead, input.CodeType, input.Count);
|
||||
}
|
||||
|
||||
public async Task<List<PrintData>> GetPrintDatas(string codeName,string codeType,int count)
|
||||
public async Task<List<PrintData>> GetPrintDatas(long? unitGroupId, string codeName,string codeType,int count)
|
||||
{
|
||||
var result = new List<PrintData>();
|
||||
if (string.IsNullOrEmpty(codeName))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
var elem = await _codeElementService.GetElementByName(codeName);
|
||||
var elem = await _codeElementService.GetElementByName(codeName, unitGroupId);
|
||||
if (elem == null)
|
||||
{ return result; }
|
||||
var config = await _codePakageConfigurationService.GetConfigByName(codeName, unitGroupId);
|
||||
if (config == null)
|
||||
{ return result; }
|
||||
var elemProp = await _codeElementPropService.CodePropByElement(new CodeElementOutput() { Id = elem.Id, CodeLength = elem.CodeLength });
|
||||
if (elemProp.Count > 0)
|
||||
{
|
||||
var prefix = (string.IsNullOrEmpty(config.CodePrefix) || codeType == "条形码") ? "" : config.CodePrefix;
|
||||
elemProp = elemProp.OrderBy(a => a.Index).ToList();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var code = GetCodeNumByProp(elemProp, i + 1);
|
||||
var code = prefix + GetCodeNumByProp(elemProp, i + 1);
|
||||
if (codeType == "条形码")
|
||||
{
|
||||
result.Add(new PrintData() { BarCode = code });
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using Admin.NET.Application.Const;
|
||||
using Admin.NET.Application.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Admin.NET.Application.Utils;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
/// <summary>
|
||||
/// 汇报单详情服务
|
||||
|
@ -191,7 +193,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
Dictionary<AddPrintCodeDetailInput, long> list = new Dictionary<AddPrintCodeDetailInput, long>();
|
||||
foreach (var item in topDatas)
|
||||
{
|
||||
var code = string.IsNullOrEmpty(item.BarCode) ? item.QrCode : item.BarCode;
|
||||
var code = CodeHelper.GetCode(item.BarCode, item.QrCode);
|
||||
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||
var unit = units.Find(a => a.Name == item.PackageName);
|
||||
|
||||
|
@ -215,7 +217,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
var childs = input.CodeDatas.FindAll(a => a.FatherCode == code);
|
||||
foreach (var child in childs)
|
||||
{
|
||||
var code2 = string.IsNullOrEmpty(child.BarCode) ? child.QrCode : child.BarCode;
|
||||
var code2 = CodeHelper.GetCode(child.BarCode, child.QrCode);
|
||||
var unit2 = units.Find(a => a.Name == child.PackageName);
|
||||
var detail2 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
|
@ -239,7 +241,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2);
|
||||
foreach (var child3 in childs3)
|
||||
{
|
||||
var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode;
|
||||
var code3 = CodeHelper.GetCode(child3.BarCode, child3.QrCode);
|
||||
var unit3 = units.Find(a => a.Name == child3.PackageName);
|
||||
var detail3 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
|
@ -264,7 +266,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3);
|
||||
foreach (var child4 in childs4)
|
||||
{
|
||||
var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode;
|
||||
var code4 = CodeHelper.GetCode(child4.BarCode, child4.QrCode);
|
||||
var unit4 = units.Find(a => a.Name == child4.PackageName);
|
||||
var detail4 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
|
@ -289,7 +291,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4);
|
||||
foreach (var child5 in childs5)
|
||||
{
|
||||
var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode;
|
||||
var code5 = CodeHelper.GetCode(child5.BarCode, child5.QrCode);
|
||||
var unit5 = units.Find(a => a.Name == child5.PackageName);
|
||||
var detail5 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Http;
|
|||
using Admin.NET.Application.Service.ReportTable.Dto;
|
||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ComponentTCBBatchCreateContainerServiceVersionRequest.Types;
|
||||
using Nest;
|
||||
using Admin.NET.Application.Utils;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
/// <summary>
|
||||
|
@ -266,7 +267,7 @@ public class ReportTableService : IDynamicApiController, ITransient
|
|||
tempUnits.AddRange(others);
|
||||
foreach (var item in input.PrintDatas)
|
||||
{
|
||||
var code = string.IsNullOrEmpty(item.BarCode) ? item.QrCode : item.BarCode;
|
||||
var code = CodeHelper.GetCode(item.BarCode, item.BarCode);
|
||||
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||
var detail = new AddPrintCodeDetailInput()
|
||||
{
|
||||
|
@ -291,10 +292,10 @@ public class ReportTableService : IDynamicApiController, ITransient
|
|||
}
|
||||
treeData1.Children = new List<PrintCodeTreeData>();
|
||||
var currUnit = tempUnits.FirstOrDefault();
|
||||
var printDatas = await _printDataService.GetPrintDatas(currUnit.Name, codeType, unit.ChildUnitCount);
|
||||
var printDatas = await _printDataService.GetPrintDatas(input.UnitGroupId, currUnit.Name, codeType, unit.ChildUnitCount);
|
||||
foreach (var dt in printDatas)
|
||||
{
|
||||
var code2 = string.IsNullOrEmpty(dt.BarCode) ? dt.QrCode : dt.BarCode;
|
||||
var code2 = CodeHelper.GetCode(dt.BarCode, dt.QrCode);
|
||||
var detail2 = new AddPrintCodeDetailInput() { TempListId = addReport, FatherCode = code, FatherId = detailId, Code = code2, ChildCount = currUnit.ChildUnitCount, CodeName = codeType, Count = 1, Unit = currUnit.Name, BaseCount = currUnit.Rate, BaseUnit = baseUnit, PrintCodeTime = DateTime.Now, CreateUserId = userId, CreateUserName = userName };
|
||||
var detailId2 = await _codeDetailService.Add(detail2);
|
||||
var treeData2 = detail2.Adapt<PrintCodeTreeData>();
|
||||
|
@ -302,10 +303,10 @@ public class ReportTableService : IDynamicApiController, ITransient
|
|||
{
|
||||
treeData2.Children = new List<PrintCodeTreeData>();
|
||||
var currUnit3 = tempUnits[1];
|
||||
var printDatas3 = await _printDataService.GetPrintDatas(currUnit3.Name, codeType, currUnit.ChildUnitCount);
|
||||
var printDatas3 = await _printDataService.GetPrintDatas(input.UnitGroupId, currUnit3.Name, codeType, currUnit.ChildUnitCount);
|
||||
foreach (var dt3 in printDatas3)
|
||||
{
|
||||
var code3 = string.IsNullOrEmpty(dt3.BarCode) ? dt3.QrCode : dt3.BarCode;
|
||||
var code3 = CodeHelper.GetCode(dt3.BarCode, dt3.QrCode);
|
||||
var detail3 = new AddPrintCodeDetailInput() { TempListId = addReport, FatherCode = code2, FatherId = detailId2, Code = code3, ChildCount = currUnit3.ChildUnitCount, CodeName = codeType, Count = 1, Unit = currUnit3.Name, BaseCount = currUnit3.Rate, BaseUnit = baseUnit, PrintCodeTime = DateTime.Now, CreateUserId = userId, CreateUserName = userName };
|
||||
var detailId3 = await _codeDetailService.Add(detail3);
|
||||
var treeData3 = detail3.Adapt<PrintCodeTreeData>();
|
||||
|
@ -313,10 +314,10 @@ public class ReportTableService : IDynamicApiController, ITransient
|
|||
{
|
||||
treeData3.Children = new List<PrintCodeTreeData>();
|
||||
var currUnit4 = tempUnits[2];
|
||||
var printDatas4 = await _printDataService.GetPrintDatas(currUnit4.Name, codeType, currUnit3.ChildUnitCount);
|
||||
var printDatas4 = await _printDataService.GetPrintDatas(input.UnitGroupId, currUnit4.Name, codeType, currUnit3.ChildUnitCount);
|
||||
foreach (var dt4 in printDatas4)
|
||||
{
|
||||
var code4 = string.IsNullOrEmpty(dt4.BarCode) ? dt4.QrCode : dt4.BarCode;
|
||||
var code4 = CodeHelper.GetCode(dt4.BarCode, dt4.QrCode);
|
||||
var detail4 = new AddPrintCodeDetailInput() { TempListId = addReport, FatherCode = code3, FatherId = detailId3, Code = code4, ChildCount = currUnit4.ChildUnitCount, CodeName = codeType, Count = 1, Unit = currUnit4.Name, BaseCount = currUnit4.Rate, BaseUnit = baseUnit, PrintCodeTime = DateTime.Now, CreateUserId = userId, CreateUserName = userName };
|
||||
var treeData4 = detail4.Adapt<PrintCodeTreeData>();
|
||||
treeData3.Children.Add(treeData4);
|
||||
|
|
|
@ -56,6 +56,16 @@ internal class CodeHelper
|
|||
}
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
public static string GetCode(string? barCode, string? qrCode)
|
||||
{
|
||||
var code = string.IsNullOrEmpty(barCode) ? qrCode : barCode;
|
||||
if (code.Contains("?code="))
|
||||
{
|
||||
code = code.Split('=').LastOrDefault();
|
||||
}
|
||||
return code;
|
||||
}
|
||||
public static string GetCodeUpLetter(int codeLen)
|
||||
{
|
||||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
|
|
@ -91,6 +91,18 @@ public class Startup : AppStartup
|
|||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
//跨域问题6.21
|
||||
//services.AddCors(options =>
|
||||
//{
|
||||
// options.AddPolicy("MyCorsPolicy",
|
||||
// builder =>
|
||||
// {
|
||||
// builder.WithOrigins("https://whois.pconline.com.cn/ipJson.jsp?ip=&json=true") // 允许的域
|
||||
// .AllowAnyHeader()
|
||||
// .AllowAnyMethod();
|
||||
// });
|
||||
//});
|
||||
|
||||
// 限流服务
|
||||
services.AddInMemoryRateLimiting();
|
||||
services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
|
||||
|
@ -192,6 +204,8 @@ public class Startup : AppStartup
|
|||
ContentTypeProvider = contentTypeProvider
|
||||
});
|
||||
|
||||
//app.UseCors("MyCorsPolicy");
|
||||
|
||||
//// 启用HTTPS
|
||||
//app.UseHttpsRedirection();
|
||||
|
||||
|
|
|
@ -3,9 +3,11 @@ enum Api {
|
|||
AddCodeElement = '/api/codeElement/add',
|
||||
DeleteCodeElement = '/api/codeElement/delete',
|
||||
UpdateCodeElement = '/api/codeElement/update',
|
||||
PageCodeElement = '/api/codeElement/page',
|
||||
PageCodeElement = '/api/codeElement/page',//ListByGroupId
|
||||
DetailCodeElement = '/api/codeElement/detail',
|
||||
GetCodeConfig = '/api/codePakageConfiguration/list',
|
||||
ListByGroupId = '/api/codeElement/listByGroupId',
|
||||
ConfigByGroupId = '/api/codePakageConfiguration/listByGroupId',
|
||||
}
|
||||
|
||||
// 增加码元素
|
||||
|
@ -54,3 +56,20 @@ export const getCodeConfig = () =>
|
|||
url: Api.GetCodeConfig,
|
||||
method: 'get',
|
||||
});
|
||||
|
||||
|
||||
// 详情码包配置
|
||||
export const listByGroupId = (unitGroupId: any) =>
|
||||
request({
|
||||
url: Api.ListByGroupId,
|
||||
method: 'get',
|
||||
data: { unitGroupId },
|
||||
});
|
||||
|
||||
// 详情码包配置
|
||||
export const configByGroupId = (unitGroupId: any) =>
|
||||
request({
|
||||
url: Api.ConfigByGroupId,
|
||||
method: 'get',
|
||||
data: { unitGroupId },
|
||||
});
|
|
@ -7,6 +7,7 @@ enum Api {
|
|||
UpdateCodePakageConfiguration = '/api/codePakageConfiguration/update',
|
||||
PageCodePakageConfiguration = '/api/codePakageConfiguration/page',
|
||||
DetailCodePakageConfiguration = '/api/codePakageConfiguration/detail',
|
||||
ListByGroupId = '/api/codePakageConfiguration/listByGroupId',
|
||||
}
|
||||
|
||||
// 增加码包配置
|
||||
|
@ -49,16 +50,6 @@ export const detailCodePakageConfiguration = (id: any) =>
|
|||
data: { id },
|
||||
});
|
||||
|
||||
export const removeDuplicates=(persons: any[] | undefined) : any[]=> {
|
||||
const uniquePersons = new Map<string, any>();
|
||||
for (const person of persons) {
|
||||
if (!uniquePersons.has(person.name)) {
|
||||
uniquePersons.set(person.name, person);
|
||||
}
|
||||
}
|
||||
|
||||
return Array.from(uniquePersons.values());
|
||||
}
|
||||
|
||||
export const padNumberToLength=(num: number, length: number) : string=> {
|
||||
let numStr = num.toString();
|
||||
|
@ -69,3 +60,10 @@ export const padNumberToLength=(num: number, length: number) : string=> {
|
|||
}
|
||||
|
||||
|
||||
// 详情码包配置
|
||||
export const listByGroupId = (unitGroupId: any) =>
|
||||
request({
|
||||
url: Api.ListByGroupId,
|
||||
method: 'get',
|
||||
data: { unitGroupId },
|
||||
});
|
|
@ -7,6 +7,7 @@ enum Api {
|
|||
DetailUnit = '/api/sysUnit/detail',
|
||||
ListUnit = '/api/sysUnit/list',
|
||||
ListUnitGroup = '/api/sysUnit/listByGroupId',
|
||||
UnitGroupList = '/api/sysUnitGroup/list',
|
||||
}
|
||||
|
||||
// 增加单位
|
||||
|
@ -64,3 +65,11 @@ export const listUnitGroup = (unitGroupId: any) =>
|
|||
method: 'get',
|
||||
data: { unitGroupId },
|
||||
});
|
||||
|
||||
// 单位组列表
|
||||
export const unitGroups = () =>
|
||||
request({
|
||||
url: Api.UnitGroupList,
|
||||
method: 'get',
|
||||
data: { },
|
||||
});
|
|
@ -51,6 +51,18 @@ export function formatDate(date: Date, format: string): string {
|
|||
return format;
|
||||
}
|
||||
|
||||
export function getCurrentDate(): string {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
|
||||
return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期是第几周
|
||||
* @param dateTime 当前传入的日期值
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
<template>
|
||||
<div class="sys-open-access-container">
|
||||
<el-dialog v-model="state.isShowDialog" :title="props.title" width="1000">
|
||||
<el-form :inline="true" :model="state.matterFrom" class="demo-form-inline" label-width="90px">
|
||||
<el-form :inline="true" :model="ruleForm" class="demo-form-inline" label-width="90px">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="名称" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.matterFrom.name" placeholder="请输入名称" clearable />
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="编码" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.matterFrom.codeNum" placeholder="请输入编码" clearable />
|
||||
<el-form-item label="编码" >
|
||||
<el-input v-model="ruleForm.codeNum" placeholder="请输入编码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="分类" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.classify" placeholder="请选择" clearable>
|
||||
<el-select v-model="ruleForm.classify" placeholder="请选择" clearable>
|
||||
<el-option :label="item.name" :value="item.id" v-for="item, index in fyListData"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
|
@ -28,23 +28,23 @@
|
|||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="state.matterFrom.specifications" placeholder="请输入" clearable />
|
||||
<el-input v-model="ruleForm.specifications" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="助记码">
|
||||
<el-input v-model="state.matterFrom.simpleNumber" placeholder="请输入" clearable />
|
||||
<el-input v-model="ruleForm.simpleNumber" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="state.matterFrom.remarks" placeholder="请输入" clearable />
|
||||
<el-input v-model="ruleForm.remarks" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="可用状态">
|
||||
<el-switch v-model="state.matterFrom.isEnable" inline-prompt active-text="启用" inactive-text="禁用" />
|
||||
<el-switch v-model="ruleForm.isEnable" inline-prompt active-text="启用" inactive-text="禁用" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" :key="key">
|
||||
|
@ -52,31 +52,35 @@
|
|||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="品牌">
|
||||
<el-select v-model="state.matterFrom.brand" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in brandDate" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select v-model="ruleForm.brand" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in brandDate" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保质期">
|
||||
<el-input v-model="state.matterFrom.shelfLife" placeholder="请输入保质期" clearable />
|
||||
<el-input v-model="ruleForm.shelfLife" placeholder="请输入保质期" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保质期单位">
|
||||
<el-input v-model="state.matterFrom.shelfLifeUnit" placeholder="请输入保质期单位" clearable />
|
||||
<el-select v-model="ruleForm.shelfLifeUnit" placeholder="请选择保质期单位" clearable>
|
||||
<el-option label="年" value= '年' />
|
||||
<el-option label="月" value= '月' />
|
||||
<el-option label="日" value= '日' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商品条形码">
|
||||
<el-input v-model="state.matterFrom.barCode" placeholder="请输入商品条形码" clearable />
|
||||
<el-input v-model="ruleForm.barCode" placeholder="请输入商品条形码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="统一零售价">
|
||||
<el-input v-model="state.matterFrom.price" placeholder="请输入统一零售价" clearable />
|
||||
<el-input v-model="ruleForm.price" placeholder="请输入统一零售价" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -85,7 +89,7 @@
|
|||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位组" prop="unitGroupId" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-select v-model="ruleForm.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-option v-for="item in state.unitGroupData" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -93,14 +97,14 @@
|
|||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="基本单位" prop="unit" :rules="[{ required: true, message: '基本单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.unit" placeholder="基本单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.unit" placeholder="基本单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产单位" prop="productUnit" :rules="[{ required: true, message: '生产单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.productUnit" placeholder="生产单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.productUnit" placeholder="生产单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -110,21 +114,21 @@
|
|||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购单位" prop="procureUnit" :rules="[{ required: true, message: '采购单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.procureUnit" placeholder="采购单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.procureUnit" placeholder="采购单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库存单位" prop="inventoryUnit" :rules="[{ required: true, message: '库存单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.inventoryUnit" placeholder="库存单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.inventoryUnit" placeholder="库存单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售单位" prop="saleUnit" :rules="[{ required: true, message: '销售单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.saleUnit" placeholder="销售单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.saleUnit" placeholder="销售单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -134,7 +138,7 @@
|
|||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="分销单位" prop="retailStoreUnit" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="state.matterFrom.retailStoreUnit" placeholder="分销单位" filterable default-first-option style="width: 100%">
|
||||
<el-select v-model="ruleForm.retailStoreUnit" placeholder="分销单位" filterable default-first-option style="width: 100%">
|
||||
<el-option v-for="item in state.unitData" :key="item.id" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -185,19 +189,21 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, watch } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { BrandApi, MaterialClassifyApi, MaterialsApi, PackageInfoApi, SysUnitGroupApi,SysUnitApi } from '/@/api-services/api';
|
||||
import { AddMaterialsInput, BrandOutput, UpdateMaterialsInput, MaterialsOutput, PackageInfoOutput, SysUnitGroupOutput, SysUnitOutput} from '/@/api-services/models';
|
||||
import { BrandApi, MaterialClassifyApi, PackageInfoApi, SysUnitGroupApi,SysUnitApi } from '/@/api-services/api';
|
||||
import { AddMaterialsInput, BrandOutput, MaterialsOutput, PackageInfoOutput, SysUnitGroupOutput, SysUnitOutput} from '/@/api-services/models';
|
||||
import { ElMessageBox, ElMessage, TabsPaneContext } from 'element-plus';
|
||||
import { addMaterials, updateMaterials,detailMaterials } from '/@/api/main/materials';
|
||||
import { listUnitGroup } from '/@/api/main/unit';
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
orgData: Array<MaterialsOutput>,
|
||||
});
|
||||
const emits = defineEmits(['handleQuery']);
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
|
||||
const ruleFormRef = ref();
|
||||
//获取物料分类
|
||||
let fyListData = ref();
|
||||
|
||||
|
@ -208,13 +214,15 @@ const fyListGet = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const ruleForm = ref<any>({});
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
isShowDialog:false,
|
||||
editOpenAccessTitle:'新增',
|
||||
tableData: [] as Array<MaterialsOutput>,
|
||||
orgTreeData: [] as Array<MaterialsOutput>,
|
||||
matterFrom: {} as AddMaterialsInput,
|
||||
tableData: [] ,//as Array<MaterialsOutput>
|
||||
orgTreeData: [] ,//as Array<MaterialsOutput>
|
||||
//matterFrom: {} ,//as AddMaterialsInput
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
},
|
||||
|
@ -230,25 +238,24 @@ const state = reactive({
|
|||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
ruleFormRef.value?.resetFields();
|
||||
//ruleFormRef.value?.resetFields();
|
||||
//state.selectedTabName = '0'; // 重置为第一个 tab 页
|
||||
//let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (row.id != undefined) {
|
||||
state.matterFrom=row;
|
||||
//var resRole = await getAPI(MaterialsApi).apiMaterialsDetailGet(row.id);
|
||||
//state.ruleForm.roleIdList = resRole.data.result;
|
||||
}else{
|
||||
state.matterFrom.isEnable=true;
|
||||
}
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailMaterials(rowData.id)).data.result;
|
||||
else{
|
||||
ruleForm.value = rowData;
|
||||
ruleForm.value.isEnable=true;
|
||||
ruleForm.value.codeNum = 'WL'+ getCurrentDate();
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
emits('handleQuery');
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
emit("reloadTable");
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fyListGet();
|
||||
|
@ -261,7 +268,6 @@ onMounted(() => {
|
|||
|
||||
const onSubmit = () => {
|
||||
console.log('submit!')
|
||||
|
||||
}
|
||||
|
||||
//获取品牌数据
|
||||
|
@ -302,42 +308,27 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|||
// };
|
||||
|
||||
let key = ref(0)
|
||||
// watch(state.isShowDialog, (newValue, oldValue) => {
|
||||
// if (!newValue) {
|
||||
// clearFormValues(state.matterFrom)
|
||||
// infoDate = [];
|
||||
|
||||
// activeName.value = '基本信息';
|
||||
// }else{
|
||||
// key.value = Math.random();
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
//提交
|
||||
const matterSubmit = async () => {
|
||||
let res;
|
||||
//console.log(state.matterFrom);
|
||||
if (props.title=='新增'){
|
||||
res = await getAPI(MaterialsApi).apiMaterialsAddPost(state.matterFrom);
|
||||
//console.log(ruleForm);
|
||||
if (props.title=='添加物料'){
|
||||
res = await addMaterials(ruleForm.value);
|
||||
}
|
||||
else {
|
||||
let update = {} as UpdateMaterialsInput
|
||||
Object.assign(update,state.matterFrom)
|
||||
res = await getAPI(MaterialsApi).apiMaterialsUpdatePost(update);
|
||||
//await UpdateInfoApi(infoDate)
|
||||
res = await updateMaterials(ruleForm.value);
|
||||
}
|
||||
// console.log('res');
|
||||
// console.log(res);
|
||||
if (res.data.code === 200) {
|
||||
if (res.code === 200) {
|
||||
state.isShowDialog = false;
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
//state.tableData.handleList();
|
||||
} else
|
||||
ElMessage.error(res.data.message!)
|
||||
}
|
||||
else
|
||||
ElMessage.error(res.message!)
|
||||
//MaterialsPage({})
|
||||
closeDialog();
|
||||
}
|
||||
|
@ -374,13 +365,26 @@ const UpdateInfoApi = async (paramsList: any[]) => {
|
|||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const unitGroupChange = async (clearBindUserId: boolean = true) => {
|
||||
var res = await getAPI(SysUnitApi).apiSysUnitListUnitGroupIdGet(state.matterFrom.unitGroupId ?? 0);
|
||||
var res = await getAPI(SysUnitApi).apiSysUnitListUnitGroupIdGet(ruleForm.value.unitGroupId ?? 0);
|
||||
state.unitData = res.data.result ?? [];
|
||||
if (clearBindUserId) {
|
||||
//state.matterFrom.id = undefined!;
|
||||
//ruleForm.id = undefined!;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function getCurrentDate(): string {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
|
||||
return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
||||
}
|
||||
|
||||
// 导出对象
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
<el-input v-model="ruleForm.codeLength" />
|
||||
</el-form-item>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="单位组" prop="unitGroupId" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-option v-for="item in unitGroup" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item prop="codeName" label="码包名称" :rules="[{ required: true, message: '码包名称不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.codeName" @change="formOnActivated" placeholder="请选择" clearable>
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in codeConfigData" :key="index" />
|
||||
|
@ -56,7 +63,8 @@
|
|||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
import { addCodeElement, updateCodeElement, detailCodeElement ,getCodeConfig} from "/@/api/main/codeElement";
|
||||
import { addCodeElement, updateCodeElement, detailCodeElement ,getCodeConfig,listByGroupId, configByGroupId} from "/@/api/main/codeElement";
|
||||
import { unitGroups } from '/@/api/main/unit';
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
|
@ -74,6 +82,7 @@
|
|||
const rules = ref<FormRules>({
|
||||
});
|
||||
const codeConfigData = ref<any>([]);
|
||||
const unitGroup = ref<any>([]);
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
|
@ -131,10 +140,26 @@
|
|||
ruleForm.value.codeLength=codeConfigData.value.find(a=>a.name==value).codeLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单位组值变更
|
||||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const unitGroupChange = async (clearBindUserId: boolean = true) => {
|
||||
var res = await configByGroupId(ruleForm.value.unitGroupId ?? 0);
|
||||
codeConfigData.value = res.data.result ?? [];
|
||||
if (clearBindUserId) {
|
||||
//ruleForm.id = undefined!;
|
||||
}
|
||||
};
|
||||
|
||||
//获取单位组数据
|
||||
const unitData = async () => {
|
||||
unitGroup.value = (await unitGroups()).data.result;
|
||||
}
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
handleCodeConfigQuery();
|
||||
unitData();
|
||||
//handleCodeConfigQuery();
|
||||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
|
|
|
@ -36,6 +36,15 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="单位组" prop="unitGroupId" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-option v-for="item in unitGroup" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
|
@ -87,13 +96,12 @@
|
|||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { auth } from '/@/utils/authFunction';
|
||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { formatDate } from '/@/utils/formatTime';
|
||||
|
||||
///@/views/labelPrinting/codeElement/component/editDialog.vue
|
||||
import editDialog from '/@/views/labelPrinting/codeElement/component/editDialog.vue'
|
||||
import editElementDialog from '/@/views/labelPrinting/codeElement/component/editElementDialog.vue'
|
||||
import { pageCodeElement, deleteCodeElement} from '/@/api/main/codeElement';
|
||||
|
||||
import { pageCodeElement, deleteCodeElement, listByGroupId} from '/@/api/main/codeElement';
|
||||
import { unitGroups } from '/@/api/main/unit';
|
||||
|
||||
const showAdvanceQueryUI = ref(false);
|
||||
const editDialogRef = ref();
|
||||
|
@ -110,6 +118,14 @@
|
|||
const editCodeElementTitle = ref("");
|
||||
const editElementTitle = ref("");
|
||||
|
||||
const ruleForm = ref<any>({});
|
||||
const unitGroup = ref<any>([])
|
||||
|
||||
//获取单位组数据
|
||||
const getUnitGroup = async () => {
|
||||
unitGroup.value = (await unitGroups()).data.result;
|
||||
}
|
||||
|
||||
// 改变高级查询的控件显示状态
|
||||
const changeAdvanceQueryUI = () => {
|
||||
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
|
||||
|
@ -180,7 +196,20 @@
|
|||
handleQuery();
|
||||
};
|
||||
|
||||
/**
|
||||
* 单位组值变更
|
||||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const unitGroupChange = async (clearBindUserId: boolean = true) => {
|
||||
console.log('object');
|
||||
var res = await listByGroupId(ruleForm.value.unitGroupId ?? 0);
|
||||
tableData.value = res.data.result ?? [];
|
||||
tableParams.value.total = res.data.result?.count ?? 0;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getUnitGroup();
|
||||
})
|
||||
handleQuery();
|
||||
</script>
|
||||
<style scoped>
|
||||
|
|
|
@ -12,6 +12,13 @@
|
|||
<el-form-item v-show="false">
|
||||
<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="unitGroupId" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-option v-for="item in unitGroup" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="码包名称" :rules="[{ required: true, message: '码包名称不能为空', trigger: 'blur' }]">
|
||||
|
@ -95,8 +102,8 @@
|
|||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import {SysUnitOutput} from '/@/api-services/models';
|
||||
import { SysUnitApi } from '/@/api-services/api';
|
||||
import { addCodePakageConfiguration, updateCodePakageConfiguration, detailCodePakageConfiguration , removeDuplicates,padNumberToLength} from "/@/api/main/codePakageConfiguration";
|
||||
|
||||
import { addCodePakageConfiguration, updateCodePakageConfiguration, detailCodePakageConfiguration , padNumberToLength} from "/@/api/main/codePakageConfiguration";
|
||||
import { unitGroups } from '/@/api/main/unit';
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
title: {
|
||||
|
@ -118,12 +125,12 @@
|
|||
unit: [] as SysUnitOutput[],//单位数据
|
||||
});
|
||||
|
||||
const unitGroup = ref<any>([])
|
||||
|
||||
|
||||
//获取单位组数据
|
||||
const unitData = async () => {
|
||||
console.log('unit');
|
||||
let res = await getAPI(SysUnitApi).apiSysUnitListGet();
|
||||
data.unit = removeDuplicates(res.data.result) || [];
|
||||
//过滤data.unit里name的值相同的
|
||||
unitGroup.value = (await unitGroups()).data.result;
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
|
@ -136,7 +143,6 @@
|
|||
else{
|
||||
ruleForm.value = rowData;
|
||||
ruleForm.value.exportFormat='条码'
|
||||
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
|
@ -179,7 +185,17 @@
|
|||
ruleForm.value.exportFormatExample = padNumberToLength(5,ruleForm.value.codeLength);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 单位组值变更
|
||||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const unitGroupChange = async (clearBindUserId: boolean = true) => {
|
||||
var res = await getAPI(SysUnitApi).apiSysUnitListUnitGroupIdGet(ruleForm.value.unitGroupId ?? 0);
|
||||
data.unit = res.data.result ?? [];
|
||||
if (clearBindUserId) {
|
||||
//ruleForm.id = undefined!;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 页面加载时
|
||||
|
|
|
@ -73,6 +73,15 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="单位组" prop="unitGroupId" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.unitGroupId" placeholder="单位组" filterable default-first-option style="width: 100%" @change="unitGroupChange">
|
||||
<el-option v-for="item in unitGroup" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
|
@ -129,7 +138,8 @@
|
|||
import {SysUnitOutput,SysUnitInput} from '/@/api-services/models';
|
||||
import { SysUnitApi } from '/@/api-services/api';
|
||||
import editDialog from '/@/views/labelPrinting/codePakageConfiguration/component/editDialog.vue'
|
||||
import { pageCodePakageConfiguration, deleteCodePakageConfiguration, removeDuplicates } from '/@/api/main/codePakageConfiguration';
|
||||
import { pageCodePakageConfiguration, deleteCodePakageConfiguration,listByGroupId } from '/@/api/main/codePakageConfiguration';
|
||||
import { unitGroups } from '/@/api/main/unit';
|
||||
|
||||
|
||||
const showAdvanceQueryUI = ref(false);
|
||||
|
@ -147,16 +157,16 @@
|
|||
unit: [] as SysUnitOutput[],//单位数据
|
||||
});
|
||||
|
||||
const ruleForm = ref<any>({});
|
||||
const unitGroup = ref<any>([])
|
||||
|
||||
//获取单位组数据
|
||||
const unitData = async () => {
|
||||
console.log('unit');
|
||||
let res = await getAPI(SysUnitApi).apiSysUnitListGet();
|
||||
data.unit = removeDuplicates(res.data.result) || [];
|
||||
//过滤data.unit里name的值相同的
|
||||
|
||||
//console.log(data.unit);
|
||||
const getUnitGroup = async () => {
|
||||
unitGroup.value = (await unitGroups()).data.result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const editCodePakageConfigurationTitle = ref("");
|
||||
|
||||
// 改变高级查询的控件显示状态
|
||||
|
@ -221,9 +231,23 @@
|
|||
handleQuery();
|
||||
};
|
||||
|
||||
/**
|
||||
* 单位组值变更
|
||||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const unitGroupChange = async (clearBindUserId: boolean = true) => {
|
||||
console.log('object');
|
||||
var res = await listByGroupId(ruleForm.value.unitGroupId ?? 0);
|
||||
tableData.value = res.data.result ?? [];
|
||||
tableParams.value.total = res.data.result?.count ?? 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
handleQuery();
|
||||
|
||||
onMounted(() => {
|
||||
getUnitGroup();
|
||||
//unitData()
|
||||
})
|
||||
|
||||
|
|
|
@ -92,12 +92,10 @@ import VueJsonPretty from 'vue-json-pretty';
|
|||
import 'vue-json-pretty/lib/styles.css';
|
||||
import {getCodeConfig} from "/@/api/main/codeElement";
|
||||
import { addReportTable, addPrintDetail} from "/@/api/main/reportTable";
|
||||
|
||||
import { getCurrentDate } from '/@/utils/formatTime';
|
||||
import { hiprint } from 'vue-plugin-hiprint';
|
||||
import providers from '../../print/component/hiprint/providers';
|
||||
import PrintPreview from '../../print/component/hiprint/preview.vue';
|
||||
import { PrintDataApiFp } from '../../../../api-services/apis/print-data-api';
|
||||
import { async } from '../../../../router/backEnd';
|
||||
import detailForm from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -177,9 +175,10 @@ const printSubmit = async () => {
|
|||
}
|
||||
hiprintTemplate.value.clear();
|
||||
hiprintTemplate.value?.update(JSON.parse(printInfoFrom.printDataTem));
|
||||
//let { width } = hiprintTemplate.value.printPanels[0].width;
|
||||
//let tempPrintData =[{qrCode: '6544898545156',barCode:'456789'},{qrCode: 'https://cli.im/deqr/other',barCode:'https://www.baidu.com/'}]
|
||||
//preViewRef.value.showDialog(hiprintTemplate.value, tempPrintData, width);
|
||||
// let { width } = hiprintTemplate.value.printPanels[0].width;
|
||||
// let tempPrintData =[{qrCode: '6544898545156',barCode:'456789'},{qrCode: 'http://49.234.181.176:5555/?code=1102500006',barCode:''}]
|
||||
// preViewRef.value.showDialog(hiprintTemplate.value, tempPrintData, width);
|
||||
|
||||
getPrintData().then(()=>{
|
||||
state.waitShowPrinter = true;
|
||||
hiprintTemplate.value.print(
|
||||
|
@ -188,13 +187,22 @@ const printSubmit = async () => {
|
|||
{
|
||||
callback: async () => {
|
||||
state.waitShowPrinter = false;
|
||||
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 details = await addPrintDetail(contexts);
|
||||
//console.log(details.data.result);
|
||||
editDialogRef.value.openDialog(details.data.result);
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
error: () => {
|
||||
console.log('2222222');
|
||||
},
|
||||
print: () => {
|
||||
console.log('33333');
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
@ -216,6 +224,7 @@ const getPrintData = async () => {
|
|||
//PrintDataMaterialsInput
|
||||
let printInput = {
|
||||
codeHead:printInfoFrom.package,
|
||||
unitGroupId:state.matterFrom.unitGroupId,
|
||||
codeLength:5,
|
||||
count:printInfoFrom.printCount,
|
||||
codeType:codeType
|
||||
|
@ -239,6 +248,7 @@ const openDialog = async (row: any) => {
|
|||
}
|
||||
state.isShowDialog = true;
|
||||
changeMode();
|
||||
printInfoFrom.batch=getCurrentDate();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -32,8 +32,6 @@ const showDialog = (hiprintTemplate: any, printData: {}, width = 210) => {
|
|||
previewContentRef.value.removeChild(previewContentRef.value.firstChild);
|
||||
}
|
||||
const newHtml = hiprintTemplate.getHtml(printData);
|
||||
// console.log('newHtml')
|
||||
// console.log(newHtml[0])
|
||||
previewContentRef.value.appendChild(newHtml[0]);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</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-select v-model="ruleForm.productType" placeholder="请选择" clearable>
|
||||
<el-option label="普通生产" value= '普通生产' />
|
||||
<el-option label="返工生产" value= '返工生产' />
|
||||
</el-select>
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
<template #default="scope">
|
||||
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportTable(scope.row)" v-auth="'reportTable:update'"> 编辑 </el-button>
|
||||
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> 详情 </el-button>
|
||||
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delReportTable(scope.row)" v-auth="'reportTable:delete'"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
Loading…
Reference in New Issue