diff --git a/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs b/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs index 1ed0206..328f3f3 100644 --- a/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs +++ b/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs @@ -283,33 +283,6 @@ public class InvoiceService : IDynamicApiController, ITransient foreach (var item in list) { var report = await GetReport(item.ReportTableId); - //var retrospect1 = new AddProductRetrospectInput() - //{ - // BaseCount = item.BaseCount, - // BaseUnit = item.BaseUnit, - // //Batch = report.Batch, - // BusinessType = report.ProductType, - // CodeType = item.CodeName, - // Location=addOutbound.Consignee, - // 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 = "发货通知单", - // SourceId = outbound, - // Unit = item.Unit, - // Name = item.CodeName, - // Code = item.Code, - // Destination = invoice.Consignee - //}; - //await _productRetrospect.Add(retrospect1); - await _productRetrospect.AddRetrospect(item.Adapt(), report, "发货通知单", addOutbound.Consignee, outbound, input.WarehousingTableId); } diff --git a/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/Dto/WarehousingInputData.cs b/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/Dto/WarehousingInputData.cs index 1363fea..edff76b 100644 --- a/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/Dto/WarehousingInputData.cs +++ b/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/Dto/WarehousingInputData.cs @@ -36,5 +36,5 @@ public class WarehousingInputData /// /// 条码数据 /// - public List CodeDatas { get; set; } + public List CodeDatas { get; set; } = new List(); } diff --git a/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/WarehousingStatisticsService.cs b/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/WarehousingStatisticsService.cs index 88174b2..f6a7b57 100644 --- a/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/WarehousingStatisticsService.cs +++ b/Admin.NET/Admin.NET.Application/Service/WarehousingStatistics/WarehousingStatisticsService.cs @@ -182,6 +182,8 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient ReportTable reportTable = null; var warehouse = await _warehouseService.Detail(new QueryByIdWarehouseInput() { Id = input.WarehouseId.Value }); var warehouseName = warehouse == null ? "" : warehouse.Name; + var baseCount = input.CodeDatas.Count; + var tempAddList = new List(); foreach (var item in input.CodeDatas) { var product = await _codeDetailService.GetByProductCode(item); @@ -189,6 +191,7 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient { continue; } + tempAddList.Add(product); //product.WarehouseID = input.WarehouseId; reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput() { Id = product.ReportTableId.Value,SourceId=product.ReportTableId }); if (reportTable==null) @@ -225,12 +228,12 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId); var baseUnit = units.FirstOrDefault().Name; - var unit = units.Find(a => a.Name == reportTable.Unit); + var unit = units.Find(a => a.Name == product.Unit); if (unit == null) unit = units.FirstOrDefault(); + baseCount = baseCount * unit.Rate.Value; 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); detail.Count += 1; if (unit != null) @@ -259,23 +262,27 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient var currentUnit = units.FirstOrDefault(a => a.Name == childs.FirstOrDefault().Unit); foreach (var c1 in childs) { - await _productRetrospect.AddRetrospect(c1.Adapt(), reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); - + var chEnt1 = c1.Adapt(); + await _productRetrospect.AddRetrospect(chEnt1, reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); + tempAddList.Add(chEnt1); var childs3 = codeDetails.FindAll(a => a.FatherCode == c1.Code); if (childs3.Count > 0) { var currentUnit3 = units.FirstOrDefault(a => a.Name == childs3.FirstOrDefault().Unit); foreach (var c3 in childs3) { - await _productRetrospect.AddRetrospect(c3.Adapt(), reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); + var chEnt3 = c3.Adapt(); + await _productRetrospect.AddRetrospect(chEnt3, reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); + tempAddList.Add(chEnt3); var childs4 = codeDetails.FindAll(a => a.FatherCode == c3.Code); if (childs4.Count > 0) { var currentUnit4 = units.FirstOrDefault(a => a.Name == childs4.FirstOrDefault().Unit); foreach (var c4 in childs4) { - await _productRetrospect.AddRetrospect(c4.Adapt(), reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); - + var chEnt4 = c4.Adapt(); + await _productRetrospect.AddRetrospect(chEnt4, reportTable, "入库单", warehouseName, reportTable.Id, input.WarehouseId); + tempAddList.Add(chEnt4); } } } @@ -284,14 +291,23 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient } } - } + + var newDetail = reportTable.Adapt(); - if (reportTable!=null) + newDetail.Count = input.CodeDatas.Count; + newDetail.BaseCount = baseCount; + if (reportTable != null) { newDetail.SourceId = reportTable?.Id; } - await Add(newDetail); + var warehousingStaId = await Add(newDetail); + foreach (var item in tempAddList) + { + item.ReportTableId = warehousingStaId; + item.Id = 0; + await _codeDetailService.Add(item.Adapt()); + } } diff --git a/Web/src/views/productionCenter/reportTable/index.vue b/Web/src/views/productionCenter/reportTable/index.vue index c36ab7f..00ccadc 100644 --- a/Web/src/views/productionCenter/reportTable/index.vue +++ b/Web/src/views/productionCenter/reportTable/index.vue @@ -195,7 +195,7 @@ // 打开查看详情页面 const readReportDetailTable = (row: any) => { printDetailTableTitle.value = '条码详情'; - console.log(row.sourceId); + //console.log(row.sourceId); printDetailDialogRef.value.openDialog(row.sourceId); }; diff --git a/Web/src/views/warehouseManagement/warehousingStatistics/index.vue b/Web/src/views/warehouseManagement/warehousingStatistics/index.vue index fc2b655..331c080 100644 --- a/Web/src/views/warehouseManagement/warehousingStatistics/index.vue +++ b/Web/src/views/warehouseManagement/warehousingStatistics/index.vue @@ -140,18 +140,18 @@ - + - - + @@ -166,10 +166,11 @@ @current-change="handleCurrentChange" layout="total, sizes, prev, pager, next, jumper" /> - + + ([]); @@ -204,7 +202,6 @@ total: 0, }); - const printWarehousingStatisticsTitle = ref(""); const editWarehousingStatisticsTitle = ref(""); const printDetailTableTitle = ref(""); @@ -230,45 +227,41 @@ await handleQuery(); }; - // 打开新增页面 - const openAddWarehousingStatistics = () => { - editWarehousingStatisticsTitle.value = '添加入库统计'; - editDialogRef.value.openDialog({}); - }; + // // 打开新增页面 + // const openAddWarehousingStatistics = () => { + // editWarehousingStatisticsTitle.value = '添加入库统计'; + // editDialogRef.value.openDialog({}); + // }; - // 打开打印页面 - const openPrintWarehousingStatistics = async (row: any) => { - printWarehousingStatisticsTitle.value = '打印入库统计'; - } - - // 打开编辑页面 - const openEditWarehousingStatistics = (row: any) => { - editWarehousingStatisticsTitle.value = '编辑入库统计'; - editDialogRef.value.openDialog(row); - }; + + // // 打开编辑页面 + // const openEditWarehousingStatistics = (row: any) => { + // editWarehousingStatisticsTitle.value = '编辑入库统计'; + // editDialogRef.value.openDialog(row); + // }; // 打开查看详情页面 const readReportDetailTable = (row: any) => { printDetailTableTitle.value = '条码详情'; //console.log(row); - printDetailDialogRef.value.openDialog(row); + printDetailDialogRef.value.openDialog(row.id); }; // 删除 - const delWarehousingStatistics = (row: any) => { - ElMessageBox.confirm(`确定要删除吗?`, "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }) - .then(async () => { - await deleteWarehousingStatistics(row); - handleQuery(); - ElMessage.success("删除成功"); - }) - .catch(() => {}); - }; + // const delWarehousingStatistics = (row: any) => { + // ElMessageBox.confirm(`确定要删除吗?`, "提示", { + // confirmButtonText: "确定", + // cancelButtonText: "取消", + // type: "warning", + // }) + // .then(async () => { + // await deleteWarehousingStatistics(row); + // handleQuery(); + // ElMessage.success("删除成功"); + // }) + // .catch(() => {}); + // }; // 改变页面容量 const handleSizeChange = (val: number) => {