提交 d7801cd6 authored 作者: 谭富强's avatar 谭富强

仓租系统报表代码与元数据

上级 7ea67311
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LQKJ.K3.CZXT.Pluglus
{
[Description("打开仓租手输费用表单"), HotUpdate]
public class Handlossfees_TCBD : AbstractSysReportPlugIn
{
public override void BarItemClick(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
{
//点击按钮事件
base.BarItemClick(e);
//当点击这个按钮,触发
if (e.BarItemKey.Equals("LQKJ_Setupfees"))
{
// 定义 listData 用于存储选中的数据
List<DataRow> listData = new List<DataRow>();
List<object> sdsw2 = new List<object>();
//调用,动态表单
DynamicFormShowParameter parameter = new DynamicFormShowParameter();
DataRow[] selectedDataRows = this.SysReportView.SelectedDataRows;
//获取选中数据添加到集合中
foreach (DataRow dataRow in selectedDataRows)
{;
listData.Add(dataRow);
}
parameter.OpenStyle.ShowType = ShowType.Floating;
//调用哪个表单
parameter.FormId = "LQKJ_Setupfeesschedule";
//通过销售订单编号,当前打开单据的单据编号查询后台数据库
parameter.CustomComplexParams.Add("listData", listData);
//打开的动态表单,加载进来
this.View.ShowForm(parameter);
}
}
}
}
...@@ -102,11 +102,16 @@ ...@@ -102,11 +102,16 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Handlossfees_TCBD.cs" />
<Compile Include="LQKJ_Setparameters_TCBD.cs" /> <Compile Include="LQKJ_Setparameters_TCBD.cs" />
<Compile Include="LQKJ_Warehouserentexpenses_PLTJ.cs" />
<Compile Include="OpenitWarehousedetails.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setupparameter.cs" /> <Compile Include="Setupparameter.cs" />
<Compile Include="STK_StockSummaryRpt.cs" /> <Compile Include="STK_StockSummaryRpt.cs" />
<Compile Include="WarehouseRentReport.cs" /> <Compile Include="WarehouseRentReport.cs" />
<Compile Include="Warehouserentsummary_Edit.cs" />
<Compile Include="Warehouserent_MXBB.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Kingdee.BOS.Web.Bill;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
namespace LQKJ.K3.CZXT.Pluglus
{
[Description("设置费用是否确认"), HotUpdate]
public class LQKJ_Warehouserentexpenses_PLTJ : AbstractDynamicFormPlugIn
{
public override void ButtonClick(ButtonClickEventArgs e)
{
if (e.Key == "F_LQKJ_CONFIRMSAVE")
{
IBillView billView = null;
DynamicObject rowData = this.View.Model.DataObject;
decimal F_LQKJ_Scanfee = Convert.ToDecimal(rowData["F_LQKJ_Scanfee"]);//一物一码扫码出库费
decimal F_LQKJ_JDchannelfee = Convert.ToDecimal(rowData["F_LQKJ_JDchannelfee"]);//京东渠道贴标费
decimal F_LQKJ_Breturnfees = Convert.ToDecimal(rowData["F_LQKJ_Breturnfees"]);//B2B退货挑选费
decimal F_LQKJ_Specialloading = Convert.ToDecimal(rowData["F_LQKJ_Specialloading"]);//特殊装货
decimal F_LQKJ_Inspectionfee = Convert.ToDecimal(rowData["F_LQKJ_Inspectionfee"]);//检查及包装费
decimal F_LQKJ_Wdbczce = Convert.ToDecimal(rowData["F_LQKJ_Wdbczce"]);//未达标仓租差额
List<DataRow> FilterValues = this.View.OpenParameter.GetCustomParameter("listData") as List<DataRow>;
if (FilterValues != null && FilterValues.Count > 0)
{
foreach (DataRow item in FilterValues)
{
billView = CreateBillView(this.Context, "LQKJ_Warehouserentexpenses");
((IBillViewService)billView).LoadData();
// 设置单据头部分的值
if(item["F_LQKJ_FDate"].ToString() == null || item["F_LQKJ_FDate"].ToString() == "")
{
billView.Model.SetValue("F_LQKJ_FDate", DateTime.Now.ToString("yyyy-MM-dd"),0);// 设置默认日期为当前日期
}
else
{
billView.Model.SetValue("F_LQKJ_FDate", item["F_LQKJ_FDate"].ToString(),0);// 业务日期
}
billView.Model.SetValue("F_LQKJ_OrgId", item["FSTOCKORGID"].ToString(), 0);//业务组织
billView.Model.SetValue("F_LQKJ_Warehouse", Convert.ToString(item["FSTOCKID"]), 0);//仓库FSTOCKID
billView.Model.SetValue("F_LQKJ_FMATERIALID", Convert.ToString(item["FMATERIALNUMBER"]), 0);//物料编码
billView.Model.SetValue("F_LQKJ_Scanfee", F_LQKJ_Scanfee, 0);//一物一码扫码出库费
billView.Model.SetValue("F_LQKJ_JDchannelfee", F_LQKJ_JDchannelfee, 0);//京东渠道贴标费
billView.Model.SetValue("F_LQKJ_Breturnfees", F_LQKJ_Breturnfees, 0);//B2B退货挑选费
billView.Model.SetValue("F_LQKJ_Specialloading", F_LQKJ_Specialloading, 0);//特殊装货
billView.Model.SetValue("F_LQKJ_Inspectionfee", F_LQKJ_Inspectionfee, 0);//检查及包装费
billView.Model.SetValue("F_LQKJ_Wdbczce", F_LQKJ_Wdbczce, 0);//未达标仓租差额
IOperationResult saveResult = billView.Model.Save();//保存单据
billView.InvokeFormOperation("Submit");//提交单据
}
}
}
this.View.ParentFormView.SendDynamicFormAction(this.View.ParentFormView);
this.View.ParentFormView.UpdateView();
this.View.ParentFormView.Refresh();
this.View.Close();
}
private BillView CreateBillView(Context ctx, string formId, string layoutId = null, object pkId = null)
{
var meta = (FormMetadata)Kingdee.BOS.ServiceHelper.MetaDataServiceHelper.Load(ctx, formId); //单据唯一标识
var form = meta.BusinessInfo.GetForm();
var param = new BillOpenParameter(formId, layoutId);
param.Context = ctx;
param.FormMetaData = meta;
if (pkId != null && !string.IsNullOrWhiteSpace(pkId.ToString()))
{
param.Status = OperationStatus.EDIT;
param.InitStatus = OperationStatus.EDIT;
param.PkValue = pkId; //单据主键内码FID
}
else
{
param.Status = OperationStatus.ADDNEW;
param.InitStatus = OperationStatus.ADDNEW;
}
param.SetCustomParameter("formID", form.Id);
param.SetCustomParameter("PlugIns", form.CreateFormPlugIns()); //插件实例模型
param.SetCustomParameter("ShowConfirmDialogWhenChangeOrg", false);
param.NetCtrlDisable = true; // 禁用网控
var provider = form.GetFormServiceProvider();
var billview = (BillView)provider.GetService(typeof(IDynamicFormView));
//var type = Type.GetType("Kingdee.BOS.Web.Import.ImportBillView,Kingdee.BOS.Web");
//var billview2 = (BillView)Activator.CreateInstance(type);
billview.Initialize(param, provider); //初始化
billview.LoadData(); //加载单据数据
return billview;
}
}
}
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DynamicObject = Kingdee.BOS.Orm.DataEntity.DynamicObject;
namespace LQKJ.K3.CZXT.Pluglus
{
[Description("[表单插件]仓租汇总报表双击某一行打开仓租明细报表"), HotUpdate]
public class OpenitWarehousedetails : AbstractSysReportPlugIn
{
public override void CellDbClick(CellEventArgs Args)
{
base.CellDbClick(Args);
//string billNo = this.View.Model.GetValue("F_LQKJ_OrgId").ToString();
DataRow[] rows = ((ISysReportView)this.View).SelectedDataRows;//获取选中的行
//DataTable dt = ((ISysReportModel)this.View.Model).DataSource;//获取数据源
//string SN = this.View.Model.GetValue("F_LQKJ_SNText", rows)?.ToString();
string F_LQKJ_FDate = Convert.ToString(rows[0]["F_LQKJ_FDate"]);
string F_LQKJ_OrgId = Convert.ToString(rows[0]["F_LQKJ_OrgId"]);
string sql = $@"/*dialect*/SELECT FORGID FROM T_ORG_ORGANIZATIONS_L WHERE FNAME='{F_LQKJ_OrgId}' AND FLOCALEID=2052";
DataTable dataTable = DBUtils.ExecuteDataSet(this.Context, sql).Tables[0];
string FORGID = string.Empty;
if (dataTable.Rows.Count>0)
{
FORGID = Convert.ToString(dataTable.Rows[0][0]);
}
// 配置报告参数
SysReportShowParameter rptShowParam = new SysReportShowParameter
{
FormId = "LQKJ_Warehouserentdetails",
IsShowFilter = false,
};
rptShowParam.CustomParams.Add("data", F_LQKJ_FDate);
rptShowParam.CustomParams.Add("orgId", FORGID);
rptShowParam.OpenStyle.ShowType = Kingdee.BOS.Core.DynamicForm.ShowType.MainNewTabPage;
this.View.ShowForm(rptShowParam);
}
}
}
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LQKJ.K3.CZXT.Pluglus
{
[Description("[表单插件]仓租汇总报表过滤框"), HotUpdate]
public class Warehouserentsummary_Edit : AbstractBillPlugIn
{
public override void DataChanged(DataChangedEventArgs e)
{
base.DataChanged(e);
//如果等于客户
if (e.Field.Key == "F_LQKJ_StartDate")
{
//如果日期填写了值,月份字段清空然后锁定,变成灰色
this.View.Model.GetValue("F_LQKJ_Datemonth",1);
this.View.GetControl("F_LQKJ_Datemonth").Enabled = false;
//刷新
this.View.UpdateView("F_LQKJ_Datemonth");
}
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论