74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
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.SAL_OUTSTOCK
|
|
{
|
|
[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["SAL_OUTSTOCKENTRY"] as DynamicObjectCollection;
|
|
if (entity != null && entity.Any())
|
|
{
|
|
this.View.ShowForm(billShowParameter, (result) =>
|
|
{
|
|
if (result != null)
|
|
{
|
|
var rows = result.ReturnData as DynamicObjectCollection;
|
|
if (rows.Any())
|
|
{
|
|
foreach (var item in entity)
|
|
{
|
|
DynamicObject row = rows.FirstOrDefault(w => w["FPackBillNo"].IsNullOrEmpty() && 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;
|
|
});
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|