This commit is contained in:
汪青 2024-07-15 22:36:48 +08:00
parent d281b1d9c1
commit 20d7c09645
5 changed files with 150 additions and 5 deletions

View File

@ -17,7 +17,7 @@
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" ShowHeader="false" Layout="VBox" AutoScroll="true" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" IsFluid="true" ShowBorder="true" ShowHeader="true" Title="现场控制点裁剪"
runat="server" EnableCollapse="true" DataKeyNames="ControlId,ParentId,ControlLevel,States" EnableTree="true"
runat="server" EnableCollapse="true" DataKeyNames="ControlId,ParentId,ControlLevel,States,MaxLevel" EnableTree="true"
TreeColumn="DetectionItems" DataIDField="ControlId" AllowPaging="false" DataParentIDField="ParentId" OnRowDataBound="Grid1_RowDataBound"
AllowCellEditing="false" ClicksToEdit="1" OnRowCommand="Grid1_RowCommand" ExpandAllTreeNodes="true" EnableMultiSelect="false">
<Toolbars>

View File

@ -30,8 +30,8 @@ namespace FineUIPro.Web.CQMS.WBS.Control
/// </summary>
public void DataBrid()
{
string strSql = @"select * from(select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition from Control_PointCropping as a where isnull(a.ProjectId,'')='' ";
string strSql1 = "select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition from Control_PointCropping as a where a.ProjectId=@ProjectId ";
string strSql = @"select * from(select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition,a.MaxLevel from Control_PointCropping as a where isnull(a.ProjectId,'')='' ";
string strSql1 = "select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition,a.MaxLevel from Control_PointCropping as a where a.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(sDetectionItems.Text.Trim()))
@ -143,8 +143,9 @@ namespace FineUIPro.Web.CQMS.WBS.Control
var rowIndex = Grid1.SelectedRowIndex;
var rowId = Grid1.DataKeys[rowIndex][0].ToString();
var maxLevel = Grid1.DataKeys[rowIndex][4] == null ? 3 : int.Parse(Grid1.DataKeys[rowIndex][4].ToString());
var controlLevel = Grid1.DataKeys[rowIndex][2] != null ? Convert.ToInt32(Grid1.DataKeys[rowIndex][2]) : 1;
if (controlLevel > 2)
if (controlLevel >= maxLevel)
{
ShowNotify("最小节点无子节点!", MessageBoxIcon.Warning);
return;

View File

@ -44,7 +44,18 @@
</f:Label>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="three" Hidden="true">
<Items>
<f:Label ID="lblThreeDetectionItems" runat="server" Label="三级质量控制点检查、检测项" LabelAlign="Right" LabelWidth="200px">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="four" Hidden="true">
<Items>
<f:Label ID="lblFourDetectionItems" runat="server" Label="四级质量控制点检查、检测项" LabelAlign="Right" LabelWidth="200px">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtDetectionItems" runat="server" Label="质量控制点检查、检测项" LabelAlign="Right" Required="true" LabelWidth="200px">

View File

@ -110,6 +110,64 @@ namespace FineUIPro.Web.CQMS.WBS.Control
txtSort.Text = num.ToString();
}
}
else if (itemModel.ControlLevel == 3)
{
one.Hidden = false;
two.Hidden = false;
three.Hidden = false;
var oneModel = parenLs.FirstOrDefault(p => p.ControlLevel == 1);
if (oneModel != null)
{
lblOneDetectionItems.Text = oneModel.DetectionItems;
}
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
if (twoModel != null)
{
lblTwoDetectionItems.Text = twoModel.DetectionItems;
}
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
if (threeModel != null)
{
lblThreeDetectionItems.Text = threeModel.DetectionItems;
}
if (string.IsNullOrWhiteSpace(this.ControlId))
{
num = Funs.DB.Control_PointCropping.Count() + 1;
txtSort.Text = num.ToString();
}
}
else if (itemModel.ControlLevel == 4)
{
one.Hidden = false;
two.Hidden = false;
three.Hidden = false;
four.Hidden = false;
var oneModel = parenLs.FirstOrDefault(p => p.ControlLevel == 1);
if (oneModel != null)
{
lblOneDetectionItems.Text = oneModel.DetectionItems;
}
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
if (twoModel != null)
{
lblTwoDetectionItems.Text = twoModel.DetectionItems;
}
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
if (threeModel != null)
{
lblThreeDetectionItems.Text = threeModel.DetectionItems;
}
var fourModel = parenLs.FirstOrDefault(p => p.ControlLevel == 4);
if (fourModel != null)
{
lblFourDetectionItems.Text = fourModel.DetectionItems;
}
if (string.IsNullOrWhiteSpace(this.ControlId))
{
num = Funs.DB.Control_PointCropping.Count() + 1;
txtSort.Text = num.ToString();
}
}
}
}
}
@ -144,6 +202,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
/// </summary>
protected void btnSave_Click(object sender, EventArgs e)
{
int maxlevel = 3;
var model = new Control_PointCropping();
model.ControlId = this.FId;
var oneControlId = string.Empty;
@ -174,6 +233,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
model.ParentId = oneModel.ControlId;
model.PlanTypeId = model.ControlId;
model.ControlLevel = 2;
maxlevel = model.MaxLevel.Value;
}
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
if (twoModel != null)
@ -183,7 +243,31 @@ namespace FineUIPro.Web.CQMS.WBS.Control
model.PlanTypeId = twoModel.ControlId;
model.SubItemsId = model.ControlId;
model.ControlLevel = 3;
maxlevel = model.MaxLevel.Value;
}
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
if (threeModel != null)
{
model.PlanId = threeModel.PlanId;
model.ParentId = threeModel.ControlId;
model.PlanTypeId = threeModel.ControlId;
model.SubItemsId = model.ControlId;
model.ControlLevel = 4;
maxlevel = model.MaxLevel.Value;
}
var fourModel = parenLs.FirstOrDefault(p => p.ControlLevel == 4);
if (fourModel != null)
{
model.PlanId = fourModel.PlanId;
model.ParentId = fourModel.ControlId;
model.PlanTypeId = fourModel.ControlId;
model.SubItemsId = model.ControlId;
model.ControlLevel = 5;
maxlevel = model.MaxLevel.Value;
}
}
}
else
@ -200,6 +284,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
model.Partition = txtPartition.Text;
model.ControlCode = txtControlCode.Text;
model.Remark = txtRemark.Text;
model.MaxLevel = maxlevel;
if (string.IsNullOrWhiteSpace(this.ControlId)) Funs.DB.Control_PointCropping.InsertOnSubmit(model);
Funs.DB.SubmitChanges();
ShowNotify("保存成功!", MessageBoxIcon.Success);
@ -229,6 +314,18 @@ namespace FineUIPro.Web.CQMS.WBS.Control
var itemCropping = Funs.DB.Control_PointCropping.FirstOrDefault(p => p.ControlId == parentId);
if (itemCropping != null)
{
//仅土建为5级 其余的都是三级,此处特殊处理
if (itemCropping.MaxLevel > 3)
{
var tsCropping = Funs.DB.Control_PointCropping.FirstOrDefault(p => p.ControlId == itemCropping.ParentId);
if (tsCropping != null)
{
ids.Add(tsCropping.ControlId);
ids.Add(tsCropping.ParentId);
ids.Add(tsCropping.PlanId);
ids.Add(tsCropping.PlanTypeId);
}
}
ids.Add(itemCropping.ControlId);
if (!string.IsNullOrWhiteSpace(itemCropping.PlanId))
{

View File

@ -122,6 +122,42 @@ namespace FineUIPro.Web.CQMS.WBS.Control
/// </remarks>
protected global::FineUIPro.Label lblTwoDetectionItems;
/// <summary>
/// three 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow three;
/// <summary>
/// lblThreeDetectionItems 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblThreeDetectionItems;
/// <summary>
/// four 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow four;
/// <summary>
/// lblFourDetectionItems 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblFourDetectionItems;
/// <summary>
/// txtDetectionItems 控件。
/// </summary>