a
This commit is contained in:
74
14.宝锐/GZ.LJY000.Biori/STK_MisDelivery/BillEventPlugInEx.cs
Normal file
74
14.宝锐/GZ.LJY000.Biori/STK_MisDelivery/BillEventPlugInEx.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.List;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GZ.LJY000.Biori.STK_MisDelivery
|
||||
{
|
||||
[HotUpdate, Description("其他出库单表单插件")]
|
||||
public class BillEventPlugInEx : AbstractDynamicFormPlugIn
|
||||
{
|
||||
|
||||
public override void BeforeUpdateValue(BeforeUpdateValueEventArgs e)
|
||||
{
|
||||
base.BeforeUpdateValue(e);
|
||||
}
|
||||
|
||||
public override void EntryBarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
base.EntryBarItemClick(e);
|
||||
|
||||
if (e.BarItemKey.Equals("tbScanPack"))
|
||||
{
|
||||
var billShowParameter = new DynamicFormShowParameter();
|
||||
if (this.Context.DBId.Equals("6735f10547df64"))
|
||||
billShowParameter.FormId = "k474702e8884e43a3b11c235d9d430f5d";
|
||||
else
|
||||
billShowParameter.FormId = "UHIK_ScanGetPack";
|
||||
|
||||
billShowParameter.ParentPageId = this.View.PageId;
|
||||
|
||||
var billObj = this.View.Model.DataObject;
|
||||
var billId = billObj["Id"].ToString();
|
||||
var entity = billObj["BillEntry"] as DynamicObjectCollection;
|
||||
if (entity != null && entity.Any())
|
||||
{
|
||||
this.View.ShowForm(billShowParameter, (result) =>
|
||||
{
|
||||
if (result != null)
|
||||
{
|
||||
var rows = result.ReturnData as DynamicObjectCollection;
|
||||
foreach (var item in entity)
|
||||
{
|
||||
//var row = rows.FirstOrDefault(w => w["FRowId"].ToString() == item["RowId"].ToString());
|
||||
var row = rows.FirstOrDefault(w => w["FMaterialID_Id"].Long2Int() == item["MaterialID_Id"].Long2Int());
|
||||
|
||||
if (row != null)
|
||||
{
|
||||
//组装单编号#
|
||||
item["FPackBillNo"] = row["FBILLNO"].ToString();
|
||||
//组装单分录行号#
|
||||
item["FPackBillSeq"] = row["FBILLSEQ"].Long2Int();
|
||||
//组装单分录内码#
|
||||
item["FPackBillEntryId"] = row["FBILLENTRYID"].Long2Int();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.View.UpdateView("FEntity");
|
||||
return;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user