From a8799ec7bb0f9502ee4c79bdf965995f9b189b1d Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 29 Nov 2023 10:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 61 ++++++++++--------- .../HJGL/WeldingManage/WeldJointEdit.aspx.cs | 13 ++-- .../HJGL/WeldingManage/WeldTask.aspx.cs | 6 ++ 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index 2cd5466a..2ed9fcc3 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -87,7 +87,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } public List Tree_hJGL_Pipelines; public int pageSize = PipelineService.pageSize; - + #endregion #region 加载页面 @@ -103,7 +103,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage HJGL_MaterialService.materialStockItems_FIELD = new List(); HJGL_MaterialService.materialStockItems_SHOP = new List(); - Tree_hJGL_Pipelines =new List (); + Tree_hJGL_Pipelines = new List(); 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); @@ -149,10 +149,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage txtTaskCode.Enabled = false; } string projectId = string.Empty; - + if (UnitWorkId != null) - { - + { + projectId = UnitWork.ProjectId; this.txtUnitWorkName.Text = UnitWork.UnitWorkName; } @@ -169,15 +169,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage private void InitTreeMenu() { this.tvControlItem.Nodes.Clear(); - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_SHOP && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); - int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_FIELD && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_SHOP && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_FIELD && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); TreeNode rootNode1 = new TreeNode(); rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP; rootNode1.Text = "工厂预制"; rootNode1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); //页码|总页 rootNode1.EnableClickEvent = true; - rootNode1.EnableExpandEvent = true; + rootNode1.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(rootNode1); if (a > 0) { @@ -195,28 +195,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.tvControlItem.Nodes.Add(rootNode2); if (b > 0) { - TreeNode newNode = new TreeNode(); + TreeNode newNode = new TreeNode(); newNode.Text = "加载管线..."; newNode.NodeID = "加载管线..."; rootNode2.Nodes.Add(newNode); } } - void AddTreeNode(string PipeArea , TreeNode node ) - { + void AddTreeNode(string PipeArea, TreeNode node) + { var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId - && x.UnitWorkId == this.UnitWorkId - && x.PipeArea == PipeArea - && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - orderby x.PipelineCode select x).ToList(); - if (!string .IsNullOrEmpty( drpFlowingSection.SelectedValue)&& drpFlowingSection.SelectedValue!=Const._Null) + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == this.UnitWorkId + && x.PipeArea == PipeArea + && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) + orderby x.PipelineCode + select x).ToList(); + if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null) { pipeline = pipeline.Where(x => x.FlowingSection == drpFlowingSection.SelectedValue).ToList(); } var joints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); - int pageindex = int.Parse(node.CommandName.Split('|')[0]); + int pageindex = int.Parse(node.CommandName.Split('|')[0]); int pageCount = int.Parse(node.CommandName.Split('|')[1]); if (pageindex <= pageCount) @@ -250,8 +251,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage node.Nodes.Add(newNode); } } - - + + } protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { @@ -269,7 +270,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } - + } #endregion @@ -293,8 +294,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node.ParentNode); } - else if (e.Node.CommandName == "2") - { + else if (e.Node.CommandName == "2") + { AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node.ParentNode); } @@ -316,7 +317,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage string pipelineId = this.tvControlItem.SelectedNodeID; var toDoMatterList = (from x in Funs.DB.View_HJGL_NoWeldJointFind - where x.PipelineId == pipelineId && x.WeldingDailyId == null &&x.JointAttribute==drpJointAttribute.SelectedValue + where x.PipelineId == pipelineId && x.WeldingDailyId == null && x.JointAttribute == drpJointAttribute.SelectedValue && (string.IsNullOrEmpty(drpWeldTypeCode.SelectedValue) || x.WeldTypeCode.Contains(drpWeldTypeCode.SelectedValue)) select x).ToList(); @@ -363,9 +364,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage private void InitDropList() { var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId - && x.UnitWorkId == this.UnitWorkId - select x.FlowingSection).Distinct().ToList(); + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == this.UnitWorkId + select x.FlowingSection).Distinct().ToList(); this.drpFlowingSection.DataTextField = "Value"; this.drpFlowingSection.DataValueField = "Value"; this.drpFlowingSection.DataSource = pipeline; @@ -570,8 +571,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage NewTask.TaskDate = Convert.ToDateTime(txtTaskDate.Text); NewTask.Tabler = this.CurrUser.PersonId; NewTask.TableDate = DateTime.Now; - - weldJoint.WeldingMode= drpWeldingMode.SelectedValue; + + weldJoint.WeldingMode = drpWeldingMode.SelectedValue; BLL.WeldJointService.UpdateWeldJoint(weldJoint); BLL.WeldTaskService.AddWeldTask(NewTask); } @@ -641,7 +642,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { e.RowSelectable = false; - }; + }; } protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs index 529ca0e1..f1ccd769 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs @@ -304,13 +304,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage } else { - SaveData(); + SaveData(true); } } /// /// 提交数据 /// - private void SaveData() + private void SaveData(bool isClosed) { // if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()) || this.drpPipingClass.SelectedValue == BLL.Const._Null || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null || this.drpWeldTypeCode.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.hdWeldingMethodId.Text) || string.IsNullOrEmpty(this.txtWpqId.Text.Trim())) if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()) || this.drpPipingClass.SelectedValue == BLL.Const._Null || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null || this.drpWeldTypeCode.SelectedValue == BLL.Const._Null) @@ -457,8 +457,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage BLL.WeldJointService.AddWeldJoint(joint); } - ShowNotify("提交成功!", MessageBoxIcon.Success); - PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + if (isClosed) + { + ShowNotify("提交成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } } /// @@ -871,7 +874,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { if (string.IsNullOrEmpty(this.WeldJointId)) { - SaveData(); + SaveData(false); } PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WeldJoint&menuId={1}", WeldJointId, BLL.Const.HJGL_WeldJointMenuId))); } diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs index 31fa3f7a..c166015b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs @@ -959,6 +959,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage string str1 = hdItemsString.Text; string str2 = hdTaskWeldJoint.Text; this.InitTreeMenu(); + tvControlItem.SelectedNode.Expanded = true; + if (tvControlItem.SelectedNode.CommandName == "单位工程") + { + tvControlItem.SelectedNode.Nodes.Clear(); + BindNodes(tvControlItem.SelectedNode); + } var unit = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID); List GetWeldingTaskList = null; if (unit == null)