From 633977311902e3caca79875b074883aeb1a72332 Mon Sep 17 00:00:00 2001 From: chenzhihao <1798906853@qq.com> Date: Wed, 28 Jan 2026 17:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=AF=BC=E5=87=BABOM=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A0=BC=E5=88=97=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WT-DMS/form_BomManage.vb | 88 +++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/WT-DMS/form_BomManage.vb b/WT-DMS/form_BomManage.vb index 0ec4c3f..5f119b1 100644 --- a/WT-DMS/form_BomManage.vb +++ b/WT-DMS/form_BomManage.vb @@ -1306,8 +1306,8 @@ Public Class form_BomManage Dim tmpGrid As New FlexCell.Grid tmpGrid.DisplayRowNumber = True - tmpGrid.Cols = DestBomGridCols.MAX + 1 - tmpGrid.Rows = GrdSourceBom.Rows + tmpGrid.Cols = DestBomGridCols.MAX + 1 - 2 + 1 + tmpGrid.Rows = GrdSourceBom.Rows + 3 tmpGrid.BackColorFixed = tmpGrid.BackColor1 @@ -1316,47 +1316,61 @@ Public Class form_BomManage tmpGrid.Cell(0, DestBomGridCols.料号PN).Text = "料号PN" tmpGrid.Cell(0, DestBomGridCols.物料名称).Text = "物料名称" tmpGrid.Cell(0, DestBomGridCols.规格描述).Text = "规格描述" - tmpGrid.Cell(0, DestBomGridCols.单位).Text = "单位" - tmpGrid.Cell(0, DestBomGridCols.用量).Text = "用量" - tmpGrid.Cell(0, DestBomGridCols.使用位置).Text = "使用位置" - tmpGrid.Cell(0, DestBomGridCols.单价).Text = "单价" - tmpGrid.Cell(0, DestBomGridCols.单位总价).Text = "单位总价" + tmpGrid.Cell(0, DestBomGridCols.单位).Text = "使用位置" + tmpGrid.Cell(0, DestBomGridCols.用量).Text = "单位" + tmpGrid.Cell(0, DestBomGridCols.使用位置).Text = "用量" + tmpGrid.Cell(0, DestBomGridCols.单价 + 1).Text = "备注" + 'tmpGrid.Cell(0, DestBomGridCols.单价).Text = "单价"‘ 2026 01 23 飞书 DMS工具优化方案,基于原本功能合并表格模版 + 'tmpGrid.Cell(0, DestBomGridCols.单位总价).Text = "单位总价" - tmpGrid.Cell(1, DestBomGridCols.序号 + 1).Text = "序号" - tmpGrid.Cell(1, DestBomGridCols.工艺流程 + 1).Text = "工艺流程" - tmpGrid.Cell(1, DestBomGridCols.料号PN + 1).Text = "料号PN" - tmpGrid.Cell(1, DestBomGridCols.物料名称 + 1).Text = "物料名称" - tmpGrid.Cell(1, DestBomGridCols.规格描述 + 1).Text = "规格描述" - tmpGrid.Cell(1, DestBomGridCols.单位 + 1).Text = "单位" - tmpGrid.Cell(1, DestBomGridCols.用量 + 1).Text = "用量" - tmpGrid.Cell(1, DestBomGridCols.使用位置 + 1).Text = "使用位置" - tmpGrid.Cell(1, DestBomGridCols.单价 + 1).Text = "单价" - tmpGrid.Cell(1, DestBomGridCols.单位总价 + 1).Text = "单位总价" - - For i = 2 To tmpGrid.Rows - 1 - If String.IsNullOrEmpty(GrdSourceBom.Cell(i, SourceGridCols.料号PN).Text) Then - tmpGrid.Cell(i, DestBomGridCols.单价 + 1).Text = "Totel:" + tmpGrid.Range(1, 1, 1, tmpGrid.Cols - 1).Alignment = FlexCell.AlignmentEnum.LeftGeneral + tmpGrid.Range(1, 1, 1, tmpGrid.Cols - 1).Merge() + '文件编号:DE-BOM-2025040101 + tmpGrid.Cell(1, 1).Text = "文件编号:DE-BOM-" & DateTime.Now.ToString("yyyyMMddHH") + tmpGrid.Range(2, 1, 2, tmpGrid.Cols - 1).Alignment = FlexCell.AlignmentEnum.LeftGeneral + tmpGrid.Range(2, 1, 2, tmpGrid.Cols - 1).Merge() + '文件日期: 2025-04-01 + tmpGrid.Cell(2, 1).Text = "文件日期: " & DateTime.Now.ToString("yyyy-MM-dd") - Dim totel As Double = 0 - For j = 2 To i - 1 - totel += tmpGrid.Cell(j, DestBomGridCols.单位总价 + 1).DoubleValue - Next + tmpGrid.Cell(4, DestBomGridCols.序号 + 1).Text = "序号" + tmpGrid.Cell(4, DestBomGridCols.工艺流程 + 1).Text = "工艺流程" + tmpGrid.Cell(4, DestBomGridCols.料号PN + 1).Text = "料号PN" + tmpGrid.Cell(4, DestBomGridCols.物料名称 + 1).Text = "物料名称" + tmpGrid.Cell(4, DestBomGridCols.规格描述 + 1).Text = "规格描述" + tmpGrid.Cell(4, DestBomGridCols.单位 + 1).Text = "使用位置" + tmpGrid.Cell(4, DestBomGridCols.用量 + 1).Text = "单位" + tmpGrid.Cell(4, DestBomGridCols.使用位置 + 1).Text = "用量" + tmpGrid.Cell(4, DestBomGridCols.单价 + 1).Text = "备注" + 'tmpGrid.Cell(1, DestBomGridCols.单价 + 1).Text = "单价" + 'tmpGrid.Cell(1, DestBomGridCols.单位总价 + 1).Text = "单位总价" - tmpGrid.Cell(i, DestBomGridCols.单位总价 + 1).Text = totel - Continue For - End If + + + For i = 5 To tmpGrid.Rows - 1 + 'If String.IsNullOrEmpty(GrdSourceBom.Cell(i, SourceGridCols.料号PN).Text) Then + ' tmpGrid.Cell(i, DestBomGridCols.单价 + 1).Text = "Totel:" + + + ' Dim totel As Double = 0 + ' For j = 2 To i - 1 + ' totel += tmpGrid.Cell(j, DestBomGridCols.单位总价 + 1).DoubleValue + ' Next + + ' tmpGrid.Cell(i, DestBomGridCols.单位总价 + 1).Text = totel + ' Continue For + 'End If tmpGrid.Cell(i, DestBomGridCols.序号 + 1).Text = i - 1 - tmpGrid.Cell(i, DestBomGridCols.工艺流程 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.工艺流程).Text - tmpGrid.Cell(i, DestBomGridCols.料号PN + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.料号PN).Text - tmpGrid.Cell(i, DestBomGridCols.物料名称 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.物料名称).Text - tmpGrid.Cell(i, DestBomGridCols.规格描述 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.规格描述).Text - tmpGrid.Cell(i, DestBomGridCols.单位 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.单位).Text - tmpGrid.Cell(i, DestBomGridCols.用量 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.用量).Text - tmpGrid.Cell(i, DestBomGridCols.使用位置 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.使用位置).Text - tmpGrid.Cell(i, DestBomGridCols.单价 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.单价).Text - tmpGrid.Cell(i, DestBomGridCols.单位总价 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.用量).IntegerValue * GrdSourceBom.Cell(i - 1, SourceGridCols.单价).DoubleValue + tmpGrid.Cell(i, DestBomGridCols.工艺流程 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.工艺流程).Text + tmpGrid.Cell(i, DestBomGridCols.料号PN + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.料号PN).Text + tmpGrid.Cell(i, DestBomGridCols.物料名称 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.物料名称).Text + tmpGrid.Cell(i, DestBomGridCols.规格描述 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.规格描述).Text + tmpGrid.Cell(i, DestBomGridCols.单位 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.使用位置).Text + tmpGrid.Cell(i, DestBomGridCols.用量 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.单位).Text + tmpGrid.Cell(i, DestBomGridCols.使用位置 + 1).Text = GrdSourceBom.Cell(i - 1 - 3, SourceGridCols.用量).Text + 'tmpGrid.Cell(i, DestBomGridCols.单价 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.单价).Text + 'tmpGrid.Cell(i, DestBomGridCols.单位总价 + 1).Text = GrdSourceBom.Cell(i - 1, SourceGridCols.用量).IntegerValue * GrdSourceBom.Cell(i - 1, SourceGridCols.单价).DoubleValue Next Try