提交 74b500df authored 作者: 彭寒菲's avatar 彭寒菲

物料替换

上级 0dfaa6df
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
using Kingdee.BOS.Core.DynamicForm.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List.PlugIn; using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util; using Kingdee.BOS.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Dynamic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -13,21 +15,18 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -13,21 +15,18 @@ namespace LF.K3.SCM.BusinessPlugin
{ {
[Description("打开物料替换弹出框")] [Description("打开物料替换弹出框")]
[HotUpdate] [HotUpdate]
public class OpenGGReplace : AbstractDynamicFormPlugIn public class GGReplaceModel : AbstractDynamicFormPlugIn
{ {
//public override void BeforeDoOperation(BeforeDoOperationEventArgs e) public override void AfterBindData(EventArgs e)
//{ {
base.AfterBindData(e);
// if (e.Operation.FormOperation.Id == "btn_tbReplace")
// { string billno = this.View.OpenParameter.GetCustomParameter("billno").ToString();
        //        //显示动态表单 billno = billno.Remove(billno.LastIndexOf(","));
        //        DynamicFormShowParameter forParameter = new DynamicFormShowParameter(); string tab = DBServiceHelper.CreateTemporaryTableName(this.Context);
string sql = $@"/*dialect*/select FNUMBER FNUMBER,FNAME FNAME,F_QAZ_REMARK F_FRONT from t_BD_MATERIAL T0
// //获取动态表单的唯一标识 left join T_BD_MATERIAL_L T1 on T0.FMATERIALID=T1.FMATERIALID WHERE T0.FMATERIALID IN ({billno}) ";
// forParameter.FormId = "qaz_GGReplace"; DBServiceHelper.Execute(this.Context, sql);
}
// this.View.ShowForm(forParameter);
// }
//}
} }
} }
...@@ -35,12 +35,6 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -35,12 +35,6 @@ namespace LF.K3.SCM.BusinessPlugin
if (e.Operation.FormOperation.Id == "FImportDate") if (e.Operation.FormOperation.Id == "FImportDate")
{ {
//if (this._filePath == null)
//{
// this.View.ShowMessage("请选择文件");
// return;
//}
//判断是否有Excel表格
if (this.IsNotNull()) if (this.IsNotNull())
{ {
//数据的操作 //数据的操作
...@@ -148,8 +142,8 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -148,8 +142,8 @@ namespace LF.K3.SCM.BusinessPlugin
strTest = strTest.Substring(1, strTest.Length - 1); strTest = strTest.Substring(1, strTest.Length - 1);
strTest = strTest.Remove(strTest.Length - 1, 1); strTest = strTest.Remove(strTest.Length - 1, 1);
//判断是否存在此表,如果存在则删除 //判断是否存在此表,如果存在则删除
//string sql2 = " IF Object_id('Tempdb..LStable') IS NOT NULL DROP TABLE LStable"; string sql2 = $@"/*dialect*/ IF Object_id('LStable') IS NOT NULL DROP TABLE LStable";
//DBUtils.Execute(this.Context, sql2); var a=DBUtils.Execute(this.Context, sql2);
//创建表 //创建表
string sql1 = "create table LStable(" + strTest; string sql1 = "create table LStable(" + strTest;
DBUtils.Execute(this.Context, sql1); DBUtils.Execute(this.Context, sql1);
...@@ -181,8 +175,8 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -181,8 +175,8 @@ namespace LF.K3.SCM.BusinessPlugin
jg = -1; jg = -1;
} }
//删除表 //删除表
string sql2 = "DROP TABLE LStable"; string sql3 = "DROP TABLE LStable";
DBUtils.Execute(this.Context, sql2); DBUtils.Execute(this.Context, sql3);
} }
//自定义方法,拼接临时表字段 //自定义方法,拼接临时表字段
private string GetCreateTmpTableNameSql(DataColumnCollection fieldColumn) private string GetCreateTmpTableNameSql(DataColumnCollection fieldColumn)
......
...@@ -7,6 +7,8 @@ using Kingdee.BOS.Core.DynamicForm; ...@@ -7,6 +7,8 @@ using Kingdee.BOS.Core.DynamicForm;
using System.ComponentModel; using System.ComponentModel;
using Kingdee.BOS.Util; using Kingdee.BOS.Util;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List;
using System.Dynamic;
namespace LF.K3.SCM.BusinessPlugin namespace LF.K3.SCM.BusinessPlugin
{ {
...@@ -28,13 +30,41 @@ namespace LF.K3.SCM.BusinessPlugin ...@@ -28,13 +30,41 @@ namespace LF.K3.SCM.BusinessPlugin
this.View.ShowForm(forParameter); this.View.ShowForm(forParameter);
} }
if(e.BarItemKey== "btn_tbReplace") if (e.BarItemKey == "btn_tbReplace")
{ {
DynamicFormShowParameter forParameter = new DynamicFormShowParameter();
//获取动态表单的唯一标识 var lv = this.View as IListView;
forParameter.FormId = "qaz_GGReplace"; if (lv == null) { return; }
string billno = "";
var selectedRows = lv.SelectedRowsInfo;
if (selectedRows == null || selectedRows.Count == 0)
{
this.View.ShowMessage("当前没有行被选中!");
return;
}
else
{
for (int i = 0; i < selectedRows.Count; i++)
{
billno+= selectedRows[i].PrimaryKeyValue.ToString()+",";
}
}
//DynamicFormShowParameter forParameter = new DynamicFormShowParameter();
////获取动态表单的唯一标识
//forParameter.FormId = "qaz_GGReplace";
//forParameter.CustomComplexParams.Add("billno", billno);
//this.View.ShowForm(forParameter);
DynamicFormShowParameter dynamicFormShowParameter =new DynamicFormShowParameter();
dynamicFormShowParameter.FormId = "qaz_GGReplace";
dynamicFormShowParameter.CustomParams.Add("billno", billno);
this.View.ShowForm(dynamicFormShowParameter);
this.View.ReturnToParentWindow(dynamicFormShowParameter);
this.View.ShowForm(forParameter);
} }
} }
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<Compile Include="ImportDatePlugin.cs" /> <Compile Include="ImportDatePlugin.cs" />
<Compile Include="ImportExcelPlugin.cs" /> <Compile Include="ImportExcelPlugin.cs" />
<Compile Include="LastOutWarningPlugin.cs" /> <Compile Include="LastOutWarningPlugin.cs" />
<Compile Include="OpenGGReplace.cs" /> <Compile Include="GGReplaceModel.cs" />
<Compile Include="OutStockEditPlugin.cs" /> <Compile Include="OutStockEditPlugin.cs" />
<Compile Include="OutStockListPlugin.cs" /> <Compile Include="OutStockListPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论