main
liangzongpeng 2024-07-03 09:47:15 +08:00
parent 44dbbc5888
commit 79838b71c8
3 changed files with 12 additions and 3 deletions

View File

@ -28,7 +28,6 @@ public class ReportTableService : IDynamicApiController, ITransient
SysUnitService repUnit, SysUnitService repUnit,
SysUnitGroupService repUnitGroup, SysUnitGroupService repUnitGroup,
PrintCodeDetailService codeDetailService, PrintCodeDetailService codeDetailService,
//ReportDetailTableService reportDetailTable,
PrintDataService printDataService, PrintDataService printDataService,
PrintRecordsService printRecordsService, PrintRecordsService printRecordsService,
ProductRetrospectService productRetrospectService) ProductRetrospectService productRetrospectService)
@ -37,7 +36,6 @@ public class ReportTableService : IDynamicApiController, ITransient
_repUnit = repUnit; _repUnit = repUnit;
_repUnitGroup = repUnitGroup; _repUnitGroup = repUnitGroup;
_codeDetailService = codeDetailService; _codeDetailService = codeDetailService;
//_reportDetailTable = reportDetailTable;
_userManager = userManager; _userManager = userManager;
_printDataService = printDataService; _printDataService = printDataService;
_printRecordsService = printRecordsService; _printRecordsService = printRecordsService;

View File

@ -184,6 +184,8 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient
var warehouseName = warehouse == null ? "" : warehouse.Name; var warehouseName = warehouse == null ? "" : warehouse.Name;
var baseCount = input.CodeDatas.Count; var baseCount = input.CodeDatas.Count;
var tempAddList = new List<PrintCodeDetail>(); var tempAddList = new List<PrintCodeDetail>();
string tempBaseUnit = null;
string tempBrand = null;
foreach (var item in input.CodeDatas) foreach (var item in input.CodeDatas)
{ {
var product = await _codeDetailService.GetByProductCode(item); var product = await _codeDetailService.GetByProductCode(item);
@ -232,6 +234,12 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient
if (unit == null) if (unit == null)
unit = units.FirstOrDefault(); unit = units.FirstOrDefault();
baseCount = baseCount * unit.Rate.Value; baseCount = baseCount * unit.Rate.Value;
if (string.IsNullOrEmpty(reportTable.Unit))
{
reportTable.Unit = product.Unit;
}
tempBaseUnit = baseUnit;
tempBrand = materials.Brand;
if (details != null && details.Any(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit)) if (details != null && details.Any(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit))
{ {
var detail = details.Find(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit); var detail = details.Find(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit);
@ -297,6 +305,9 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient
var newDetail = reportTable.Adapt<AddWarehousingStatisticsInput>(); var newDetail = reportTable.Adapt<AddWarehousingStatisticsInput>();
newDetail.Count = input.CodeDatas.Count; newDetail.Count = input.CodeDatas.Count;
newDetail.BaseCount = baseCount; newDetail.BaseCount = baseCount;
newDetail.WarehousingDate = DateTime.Now;
newDetail.BaseUnit = tempBaseUnit;
newDetail.Brand = tempBrand;
if (reportTable != null) if (reportTable != null)
{ {
newDetail.SourceId = reportTable?.Id; newDetail.SourceId = reportTable?.Id;

View File

@ -196,7 +196,7 @@
const readReportDetailTable = (row: any) => { const readReportDetailTable = (row: any) => {
printDetailTableTitle.value = '条码详情'; printDetailTableTitle.value = '条码详情';
//console.log(row.sourceId); //console.log(row.sourceId);
printDetailDialogRef.value.openDialog(row.sourceId); printDetailDialogRef.value.openDialog(row.id);
}; };
// //