2022-11-25 焊接材料匹配任务清单树优化
This commit is contained in:
@@ -150,7 +150,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
Model.ResponeData responeData = new Model.ResponeData();
|
||||
|
||||
string result = string.Empty;
|
||||
//string result = string.Empty;
|
||||
List<string> result = new List<string> () ;
|
||||
int ic, ir;
|
||||
ic = pds.Columns.Count;
|
||||
ir = pds.Rows.Count;
|
||||
@@ -175,39 +176,41 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
if (string.IsNullOrEmpty(pipelinecode))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|";
|
||||
//result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|";
|
||||
result.Add("第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!");
|
||||
}
|
||||
else
|
||||
{
|
||||
pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pipelinecode);
|
||||
if (pipeline == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
|
||||
|
||||
//result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
|
||||
result.Add("不存在此管线号-"+ pipelinecode);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(PipelineComponentCode))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|";
|
||||
//result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|";
|
||||
result.Add("第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!");
|
||||
}
|
||||
else
|
||||
{
|
||||
hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(PipelineComponentCode, pipeline.PipelineId);
|
||||
if (hJGL_Pipeline_Component == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |";
|
||||
|
||||
//result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |";
|
||||
result.Add("不存在此预制组件-" + PipelineComponentCode);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
if (result.Count>0)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
result = result.Substring(0, result.LastIndexOf("|"));
|
||||
errorInfos = result;
|
||||
// result = result.Substring(0, result.LastIndexOf("|"));
|
||||
errorInfos = string .Join("|", result.Distinct()) ;
|
||||
//Alert alert = new Alert();
|
||||
//alert.Message = result;
|
||||
//alert.Target = Target.Self;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<Items>
|
||||
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="管线列表"
|
||||
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
|
||||
EnableSingleClickExpand="true" AutoLeafIdentification="true"
|
||||
EnableSingleClickExpand="true" AutoLeafIdentification="true" OnNodeExpand="tvControlItem_TreeNodeExpanded"
|
||||
EnableTextSelection="true" >
|
||||
</f:Tree>
|
||||
</Items>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
if (!IsPostBack)
|
||||
{
|
||||
PipeArea = Request.Params["PipeArea"];
|
||||
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
|
||||
|
||||
this.InitTreeMenu();//加载树
|
||||
}
|
||||
}
|
||||
@@ -159,6 +162,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
pipeline= pipeline.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim())).ToList();
|
||||
}
|
||||
|
||||
foreach (var item in pipeline)
|
||||
{
|
||||
//var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();
|
||||
|
||||
Reference in New Issue
Block a user