20230221焊接修改

This commit is contained in:
2023-02-21 16:36:13 +08:00
parent 8e8eecbcfc
commit c1960a5ff5
22 changed files with 575 additions and 805 deletions
@@ -82,7 +82,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork1)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
@@ -110,7 +110,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
@@ -160,6 +160,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode + "【" + comCount.ToString() + " " + "组件" + "】";
newNode.ToolTip = "管线号【组件数】";
newNode.CommandName = "管线";
newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
@@ -197,21 +198,30 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
if (e.CommandName.Split('|').Length == 2)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
WeldingDailyService.InitDownListByUnitWortId(drpWeldingDailyCode, true, this.tvControlItem.SelectedNodeID);
}
if (e.CommandName == "加载")
else if (e.CommandName == "管线")
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
}
}
else if (e.CommandName == "加载")
{
string CommandName = e.Node.ParentNode.CommandName;
e.Node.ParentNode.CommandName = ( int.Parse( CommandName.Split('|')[0])+1)+"|"+ int.Parse(CommandName.Split('|')[1]);
e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]);
TreeNode treeNode = e.Node.ParentNode;
treeNode.Nodes.Remove(e.Node);
BindNodes(e.Node.ParentNode);
}
this.BindGrid();
}
#endregion
@@ -222,7 +232,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary>
private void BindGrid()
{
string strSql = @" SELECT com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,
string strSql = @" SELECT distinct com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,
com.QRCode,com.State,com.ProductionState,pipe.PlanStartDate,com.DrawingName,com.ReceiveDate,
person.PersonName
@@ -231,12 +241,29 @@ namespace FineUIPro.Web.HJGL.PreDesign
LEFT JOIN dbo.Base_Unit punit ON punit.UnitId=com.PreUnit
LEFT JOIN dbo.Base_Unit aunit ON aunit.UnitId=com.AssembleUnit
LEFT JOIN Person_Persons person on com.ReceiveMan=person.PersonId
WHERE com.PipelineId =@PipelineId ";
List<SqlParameter> listStr = new List<SqlParameter> { };
LEFT JOIN HJGL_WeldJoint joint on joint.PipelineId =com.PipelineId
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
// strSql += " AND com.PipelineId =@PipelineId";
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
{
strSql += " and pipe.UnitWorkId =@UnitWorkId";
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
}
else if (tvControlItem.SelectedNode.CommandName=="管线")
{
strSql += " and com.PipelineId = @PipelineId ";
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
}
if (drpWeldingDailyCode.SelectedValue!=Const._Null &&!string.IsNullOrEmpty(drpWeldingDailyCode.SelectedValue))
{
strSql += " and joint.WeldingDailyId = @WeldingDailyId ";
listStr.Add(new SqlParameter("@WeldingDailyId", drpWeldingDailyCode.SelectedValue));
}
if (!string.IsNullOrEmpty(txtPipelineComponentCode.Text))
{
strSql += " AND com.PipelineComponentCode like @PipelineComponentCode";
@@ -323,7 +350,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
protected void btnPrint_Click(object sender, EventArgs e)
{
Print(tvControlItem.SelectedNodeID,"");
@@ -451,6 +477,38 @@ namespace FineUIPro.Web.HJGL.PreDesign
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "PreviewQRCode")
{
var ID = e.RowID;
var q = HJGL_PipelineComponentService.GetPipelineComponentById(ID);
string path = "";
if (!string.IsNullOrEmpty(q.QRCode))
{
path = BLL.CreateQRCodeService.CreateCode_Simple(q.QRCode, ID);
if (!string.IsNullOrEmpty(path))
{
string filepath = Funs.SGGLUrl + path.Replace("\\", "//");
ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script type='text/javascript'>window.open('" + filepath + "');</script>");
}
}
}
else if (e.CommandName == "cmd_print")
{
string Id = this.Grid1.SelectedRowID;
Print(tvControlItem.SelectedNodeID, Id);
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
@@ -474,17 +532,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
this.BindGrid();
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Tree_TextChanged(object sender, EventArgs e)
protected void btnTreeFind_Click1(object sender, EventArgs e)
{
this.InitTreeMenu();
tvControlItem.CollapseAllNodes(tvControlItem.Nodes[1].Nodes);
this.BindGrid();
}
#endregion
@@ -493,10 +544,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
public string ConvertImageUrlByImage(object str, object id)
{
string path = string.Empty;
@@ -572,31 +619,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "PreviewQRCode")
{
var ID = e.RowID;
var q = HJGL_PipelineComponentService.GetPipelineComponentById(ID);
string path = "";
if (!string.IsNullOrEmpty(q.QRCode))
{
path = BLL.CreateQRCodeService.CreateCode_Simple(q.QRCode, ID);
if (!string.IsNullOrEmpty(path))
{
string filepath = Funs.SGGLUrl + path.Replace("\\", "//");
ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script type='text/javascript'>window.open('" + filepath + "');</script>");
}
}
}
else if (e.CommandName == "cmd_print")
{
string Id = this.Grid1.SelectedRowID;
Print(tvControlItem.SelectedNodeID, Id);
}
}
}
}