From 3e24c8185d2c721c9d98ed5eb947dc626a00d678 Mon Sep 17 00:00:00 2001 From: liangjunyu <13726812+shifang-tianhua_0@user.noreply.gitee.com> Date: Tue, 9 Sep 2025 09:43:05 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E6=8E=A8=E5=8F=91=E8=B4=A7=E5=87=BA=E5=BA=93=E5=8D=95=E5=B8=A6?= =?UTF-8?q?=E5=87=BA=E5=AF=B9=E5=BA=94=E7=9A=84=E9=85=8D=E4=BB=B6=202.?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E9=80=9A=E7=9F=A5=E5=8D=95=E4=B8=AD=E4=B8=BB?= =?UTF-8?q?=E4=BD=93=E7=89=A9=E6=96=99=E4=B8=8E=E9=85=8D=E4=BB=B6=E7=89=A9?= =?UTF-8?q?=E6=96=99=E7=9A=84=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs | 24 +++++++++++-------- .../SaleOrder_DeliveryNoticeConvert.cs | 19 +++++++-------- Pilot_KD_Parino/SQL/SqlManage.cs | 6 +---- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs index 51fc2de..a0e5a16 100644 --- a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs +++ b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs @@ -39,9 +39,9 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE var groupId = groupIdObj == null ? "" : groupIdObj.Convert(); if (!groupId.IsNullOrEmptyOrWhiteSpace()) { - var groupItemObj = this.View.Model.GetValue("F_GroupItem", e.Row); - var groupItem = groupItemObj == null ? "" : groupItemObj.Convert(); - if (groupItem.IsNullOrEmptyOrWhiteSpace()) + var groupItemObj = this.View.Model.GetValue("F_IsGroupItem", e.Row); + var groupItem = groupItemObj == null ? false : groupItemObj.Convert(); + if (!groupItem) { var entrys = this.View.Model.DataObject["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection; if (entrys != null && entrys.Count > 0) @@ -51,8 +51,8 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE foreach (var entry in entrys) { var currGroup = entry["FGroup"].Convert(); - var currGroupItem = entry["F_GroupItem"].Convert(); - if (currGroup.EqualsIgnoreCase(groupId) && !currGroupItem.IsNullOrEmptyOrWhiteSpace()) + var currGroupItem = entry["F_IsGroupItem"].Convert(); + if (currGroup.EqualsIgnoreCase(groupId) && currGroupItem) { var currGroupDosage = entry["F_GroupDosage"].Convert(); this.View.Model.SetValue("FQty", mainQty * currGroupDosage, currIndex); @@ -67,6 +67,10 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE } + /// + /// 删除主体物料时,删除其对应的配件物料 + /// + /// public override void AfterDeleteRow(AfterDeleteRowEventArgs e) { @@ -79,9 +83,9 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE if (groupId.IsNullOrEmptyOrWhiteSpace()) return; - var groupItemObj = currDataEntity["F_GroupItem"]; - var groupItem = groupItemObj == null ? "" : groupItemObj.Convert(); - if (!groupItem.IsNullOrEmptyOrWhiteSpace()) + var groupItemObj = this.View.Model.GetValue("F_IsGroupItem", e.Row); + var groupItem = groupItemObj == null ? false : groupItemObj.Convert(); + if (!groupItem) return; var entrys = this.View.Model.DataObject["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection; @@ -93,8 +97,8 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE foreach (var entry in entrys) { var currGroup = entry["FGroup"].Convert(); - var currGroupItem = entry["F_GroupItem"].Convert(); - if (currGroup.EqualsIgnoreCase(groupId) && !currGroupItem.IsNullOrEmptyOrWhiteSpace()) + var currGroupItem = entry["F_IsGroupItem"].Convert(); + if (currGroup.EqualsIgnoreCase(groupId) && currGroupItem) { deleteIndexs.Add(rowIndex); } diff --git a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs index 42a6085..2abc7be 100644 --- a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs +++ b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs @@ -44,7 +44,6 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE.ConvertServicePlugIn var qty = entry["Qty"].Convert(); var guid = Guid.NewGuid().ToString("N"); - //entry["FGroup"] = guid; sqlL.Add($"SELECT {idx} 'Idx',{materialId} MaterialId,{qty} MaterialQty,'{guid}' GroupId"); idx++; @@ -92,18 +91,16 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE.ConvertServicePlugIn //单位 billView.Model.SetItemValueByID("FUnitID", item["FCHILDUNITID"].Long2Int(), rowIndex); billView.InvokeFieldUpdateService("FUnitID", rowIndex); + //仓库 + billView.Model.SetItemValueByID("FStockID", item["FSTOCKID"].Long2Int(), rowIndex); + billView.InvokeFieldUpdateService("FStockID", rowIndex); - billView.Model.SetValue("F_GroupItem", Guid.NewGuid().ToString("N"), rowIndex); + //表体备注 + billView.Model.SetValue("FNoteEntry", item["FNOTE"], rowIndex); + + //billView.Model.SetValue("F_GroupItem", Guid.NewGuid().ToString("N"), rowIndex); + billView.Model.SetValue("F_IsGroupItem", true, rowIndex); - //billView.GetFieldEditor("FMaterialID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FUnitID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FQty", rowIndex).Enabled = false; - //billView.GetFieldEditor("FIsFree", rowIndex).Enabled = false; - //billView.GetFieldEditor("FDeliveryDate", rowIndex).Enabled = false; - ////billView.GetFieldEditor("FStockID", rowIndex).Enabled = false; - ////billView.GetFieldEditor("FStockLocID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FTaxPrice", rowIndex).Enabled = false; - //billView.GetFieldEditor("FEntryTaxRate", rowIndex).Enabled = false; } } } diff --git a/Pilot_KD_Parino/SQL/SqlManage.cs b/Pilot_KD_Parino/SQL/SqlManage.cs index 18b870e..431b781 100644 --- a/Pilot_KD_Parino/SQL/SqlManage.cs +++ b/Pilot_KD_Parino/SQL/SqlManage.cs @@ -528,11 +528,6 @@ namespace Pilot_KD_Parino.SQL return DBServiceHelper.ExecuteDynamicObject(ctx, sql.ToString(), null, null, CommandType.Text, null) as DynamicObjectCollection; } - - - - - /// /// 更新销售订单的是否分摊 /// @@ -590,6 +585,7 @@ namespace Pilot_KD_Parino.SQL {string.Join(" UNION ALL ", sqlL)} ) SELECT tt.*,t0.FMATERIALID,t0.FAUXQTY,t0e.FSEQ,t0e.FMATERIALIDCHILD,t0e.FQTY,t0e.FCHILDUNITID + ,t0e.FNOTE,t0e.FSTOCKID FROM #基础数据 tt INNER JOIN t_MainDodyParts t0 on t0.FMATERIALID = tt.MaterialId INNER JOIN t_MainDodyPartsEntry t0e on t0.FID = t0e.FID