From 13d3a96f0c3c82648211aa9c7208ba54b8006f03 Mon Sep 17 00:00:00 2001 From: zhougf Date: Wed, 22 Oct 2025 13:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=93=81=E5=BA=93=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9B=BE=E5=8F=B7=EF=BC=8C=E7=B2=BE=E7=AE=80=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SimpleReceiptInController.cs | 4 +-- .../Views/SimpleReceiptIn/Index.cshtml | 33 +++++++++++++++---- HHWMS.Web/Support/Profiles/MapToHisProfile.cs | 1 + 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs index 4bc308c..aecf70c 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs @@ -68,9 +68,9 @@ namespace HHWMS.Web.Controllers Id = x.ID, ContainerCode = x.ContainerCode, MaterialCode = x.MaterialCode, - MaterialName = x.MaterialName, + MaterialName = x.MaterialType, MaterialSpec = x.MaterialSpec, - Company = x.CompanyCode, + CompanyCode = x.CompanyCode, Batch = x.Batch, Qty = (int)x.Qty }) diff --git a/HHWMS.Web/Areas/Receipt/Views/SimpleReceiptIn/Index.cshtml b/HHWMS.Web/Areas/Receipt/Views/SimpleReceiptIn/Index.cshtml index b71745d..3c6c7bf 100644 --- a/HHWMS.Web/Areas/Receipt/Views/SimpleReceiptIn/Index.cshtml +++ b/HHWMS.Web/Areas/Receipt/Views/SimpleReceiptIn/Index.cshtml @@ -160,14 +160,17 @@ { title: '容器编码', dataIndex: 'ContainerCode', + width: 100 }, { title: '物料编码', dataIndex: 'MaterialCode', + width: 120, }, { - title: '物料名称', + title: '图号', dataIndex: 'MaterialName', + width: 120, }, { title: '物料型号', @@ -240,7 +243,7 @@ getFilteredTips(type, inputVal) { if (!inputVal) { // 没有输入时显示所有历史记录 - console.log(1) + return this.history[type].map(item => ({ value: item })); } // 输入时过滤匹配的记录(不区分大小写) @@ -262,7 +265,7 @@ // 添加到最前面(最新的在最上面) history.unshift(value); // 限制最多保存10条 - if (history.length > 10) { + if (history.length > 20) { history.pop(); } // 保存到本地存储 @@ -477,7 +480,12 @@ }, handleDelete(record) { - const index = this.bindList.findIndex(item => item.id === record.id); + if (!record || !record.Id) { + this.$message.error("无效的记录"); + return; + } + + const index = this.bindList.findIndex(item => item.Id === record.Id); if (index > -1) { // 调用后端删除库存 @@ -502,7 +510,13 @@ }, handleEdit(record) { - this.editForm.index = this.bindList.findIndex(item => item.id === record.id); + if (!record || !record.Id) { + this.$message.error("无效的记录"); + return; + } + + this.editForm.index = this.bindList.findIndex(item => item.Id === record.Id); + this.editForm.qty = Math.floor(record.Qty); this.editModalVisible = true; }, @@ -548,7 +562,12 @@ }, handleDeduct(record) { - this.deductForm.index = this.bindList.findIndex(item => item.id === record.id); + if (!record || !record.Id) { + this.$message.error("无效的记录"); + return; + } + + this.deductForm.index = this.bindList.findIndex(item => item.Id === record.Id); this.deductForm.qty = null; this.deductForm.maxQty = Math.floor(record.Qty); this.deductModalVisible = true; @@ -573,7 +592,7 @@ this.$notification.error("扣除数量不能大于当前数量"); return; } -console.log(1); + const newQty = record.Qty - this.deductForm.qty; if (newQty === 0) { diff --git a/HHWMS.Web/Support/Profiles/MapToHisProfile.cs b/HHWMS.Web/Support/Profiles/MapToHisProfile.cs index 297dc25..b814f2d 100644 --- a/HHWMS.Web/Support/Profiles/MapToHisProfile.cs +++ b/HHWMS.Web/Support/Profiles/MapToHisProfile.cs @@ -27,6 +27,7 @@ namespace HHWMS.Web.Support.Profiles .ForMember( dest => dest.CreateTime, src => src.MapFrom(x => DateTime.Now)) + .ForMember(x => x.ID, opt => opt.Ignore()) ; // 任务明细 --> 库存交易