2022-11-25 焊接材料匹配任务清单树优化
This commit is contained in:
@@ -94,6 +94,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
|
||||
|
||||
this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
|
||||
this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text);
|
||||
BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true);
|
||||
@@ -161,19 +164,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
rootNode1.Text = "工厂预制";
|
||||
rootNode1.CommandName = "工厂预制";
|
||||
rootNode1.EnableClickEvent = true;
|
||||
rootNode1.Selectable = true;
|
||||
rootNode1.EnableExpandEvent = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode1);
|
||||
|
||||
int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP select x).Count();
|
||||
if (a > 0)
|
||||
{
|
||||
// BindNodes(tn1);
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
rootNode1.Nodes.Add(newNode);
|
||||
}
|
||||
|
||||
TreeNode rootNode2 = new TreeNode();
|
||||
rootNode2.NodeID = BLL.PipelineService.PipeArea_FIELD;
|
||||
rootNode2.Text = "现场安装";
|
||||
rootNode2.CommandName = "现场安装";
|
||||
rootNode2.EnableClickEvent = true;
|
||||
rootNode2.Expanded = true;
|
||||
rootNode2.EnableExpandEvent = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode2);
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, rootNode1);
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, rootNode2);
|
||||
|
||||
int b = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD select x).Count();
|
||||
if (b > 0)
|
||||
{
|
||||
// BindNodes(tn1);
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
rootNode2.Nodes.Add(newNode);
|
||||
}
|
||||
//TreeNode rootNode = new TreeNode();
|
||||
//rootNode.Text = "管线号";
|
||||
//rootNode.NodeID = "0";
|
||||
@@ -185,12 +204,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
void AddTreeNode(string PipeArea , TreeNode node )
|
||||
{
|
||||
var iso = (from x in Funs.DB.HJGL_Pipeline where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
|
||||
var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
|
||||
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
|
||||
{
|
||||
iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList();
|
||||
}
|
||||
var joints = from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
var joints = from x in WeldJointService.hJGL_WeldJoints select x;
|
||||
foreach (var item in iso)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
@@ -208,14 +227,31 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
node.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
|
||||
{
|
||||
if (e.Node.Nodes[0].NodeID == "加载管线...")
|
||||
{
|
||||
e.Node.Nodes.Clear();
|
||||
if (e.Node.CommandName == "工厂预制")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node);
|
||||
|
||||
#endregion
|
||||
}
|
||||
else if (e.Node.CommandName == "现场安装")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node);
|
||||
|
||||
#region 数据绑定
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 数据绑定
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string pipelineId = this.tvControlItem.SelectedNodeID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user