This commit is contained in:
李云虎 2024-05-12 14:50:57 +08:00
parent 3351bc42ce
commit e30929f61d
3 changed files with 116 additions and 37 deletions

View File

@ -107,12 +107,23 @@
</f:Form> </f:Form>
</Items> </Items>
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="检测单明细" EnableCollapse="true" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,HotProessTrust %>"
runat="server" BoxFlex="1" DataKeyNames="NDEItemID" AllowCellEditing="true" AllowColumnLocking="true" EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="ID"
EnableColumnLines="true" ClicksToEdit="2" DataIDField="NDEItemID" AllowSorting="true" AllowCellEditing="true" AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
SortField="PipelineCode,WeldJointCode" SortDirection="ASC" OnSort="Grid1_Sort" DataIDField="ID" AllowSorting="true" SortField="PipelineCode,WeldJointCode"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
EnableTextSelection="True"> PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:TextBox ID="txtIsoNo" Label="<%$ Resources:Lan,PipelineCode %>" runat="server"
LabelWidth="120px" LabelAlign="Right" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill2" runat="server">
</f:ToolbarFill>
</Items>
</f:Toolbar>
</Toolbars>
<Columns> <Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="<%$ Resources:Lan,SerialNumber %>" <f:RowNumberField EnablePagingNumber="true" HeaderText="<%$ Resources:Lan,SerialNumber %>"
Width="50px" HeaderTextAlign="Center" TextAlign="Center" /> Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
@ -132,10 +143,20 @@
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center" DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="120px"> TextAlign="Center" Width="120px">
</f:RenderField> </f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,TrustDate %>" ColumnID="ProessDate" <f:RenderField HeaderText="<%$ Resources:Lan,TrustDate %>" ColumnID="CreatedTime"
DataField="ProessDate" SortField="ProessDate" FieldType="Date" Renderer="Date" DataField="CreatedTime" SortField="CreatedTime" FieldType="Date" Renderer="Date"
HeaderTextAlign="Center" TextAlign="Left" Width="120px"> HeaderTextAlign="Center" TextAlign="Left" Width="120px">
</f:RenderField> </f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,QualityNo %>" ColumnID="QualityNo" DataField="QualityNo"
FieldType="String" TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,Acceptance %>" ColumnID="Acceptance"
DataField="Acceptance" FieldType="String" TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,IsPass %>" ColumnID="StatusText"
DataField="StatusText" SortField="status" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
</Columns> </Columns>
<Listeners> <Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" /> <f:Listener Event="dataload" Handler="onGridDataLoad" />

View File

@ -8,6 +8,7 @@ using System.Web;
using System.Collections; using System.Collections;
using Model; using Model;
using static System.Windows.Forms.VisualStyles.VisualStyleElement; using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using FineUIPro.Web.common.ProjectSet;
namespace FineUIPro.Web.WeldingProcess.PMI namespace FineUIPro.Web.WeldingProcess.PMI
{ {
@ -48,8 +49,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI
{ {
if (!string.IsNullOrEmpty(this.txtNDEDateMonth.Text.Trim())) if (!string.IsNullOrEmpty(this.txtNDEDateMonth.Text.Trim()))
{ {
DateTime startTime = Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01");
DateTime endTime = startTime.AddMonths(1);
this.tvControlItem.Nodes.Clear(); this.tvControlItem.Nodes.Clear();
List<Model.Base_Unit> units = new List<Model.Base_Unit>(); List<Model.Base_Unit> units = new List<Model.Base_Unit>();
Model.Project_Unit pUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId); Model.Project_Unit pUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
@ -96,30 +95,20 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="node"></param> /// <param name="node"></param>
private void BindNodes(TreeNode node) private void BindNodes(TreeNode node)
{ {
DateTime startTime = Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01");
DateTime endTime = startTime.AddMonths(1);
string searchCode = this.txtSearchCode.Text.Trim();
if (node.ToolTip == "Unit") if (node.ToolTip == "Unit")
{ {
///装置 string unitId = node.NodeID;
var install = (from x in Funs.DB.Project_Installation var ndt = from x in Funs.DB.PMI_Delegation
join y in Funs.DB.PMI_Delegation on x.InstallationId equals y.InstallationId where x.UnitId == unitId
where y.UnitId == node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId && x.ProjectId == this.CurrUser.LoginProjectId
orderby x.InstallationCode && x.DelegationDate >= startTime && x.DelegationDate <= endTime
select x).Distinct(); &&( x.DelegationNo.Contains(searchCode)|| searchCode=="")
foreach (var q in install) select x;
{ //if (!string.IsNullOrWhiteSpace(searchCode))
TreeNode newNode = new TreeNode(); // ndt = ndt.Where(q => q.DelegationNo.Contains(searchCode));
newNode.Text = q.InstallationName;
newNode.NodeID = q.InstallationId + "|" + node.NodeID;
newNode.ToolTip = "Installation";
node.Nodes.Add(newNode);
BindNodes(newNode);
}
}
else if (node.ToolTip == "Installation")
{
string[] unitAndInstallationArr= node.NodeID.Split('|');
var ndt = from x in Funs.DB.PMI_Delegation where x.UnitId == unitAndInstallationArr[1]
&& x.InstallationId == unitAndInstallationArr[0]
&& x.ProjectId == this.CurrUser.LoginProjectId select x;
foreach (var q in ndt) foreach (var q in ndt)
{ {
@ -162,10 +151,49 @@ namespace FineUIPro.Web.WeldingProcess.PMI
{ {
if (!string.IsNullOrWhiteSpace(this.hdPMIId.Text) && this.tvControlItem.SelectedNode.ToolTip == "DelegationNo") if (!string.IsNullOrWhiteSpace(this.hdPMIId.Text) && this.tvControlItem.SelectedNode.ToolTip == "DelegationNo")
{ {
string strSql = string.Empty;
List<SqlParameter> listStr = new List<SqlParameter>();
this.SetTextTemp(); this.SetTextTemp();
this.PageInfoLoad(); ///页面输入提交信息 this.PageInfoLoad(); ///页面输入提交信息
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
var result = Funs.DB.PMI_Delegation.FirstOrDefault(t => t.Id == this.tvControlItem.SelectedNodeID);
if (result != null)
{
this.PMIID = result.Id;
strSql = @"SELECT *,
(case status when 0 then '' else '' end) StatusText
FROM [View_PMI_DelegationDetails] WHERE ProjectId= @ProjectId AND PMIID=@PMIDelegationId ";
listStr.Add(new SqlParameter("@ProjectId", result != null ? result.ProjectId : this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@PMIDelegationId", this.PMIID));
if (!string.IsNullOrEmpty(this.txtIsoNo.Text.Trim()))
{
strSql += @" and PipelineCode like '%'+@PipelineCode+'%' ";
listStr.Add(new SqlParameter("@PipelineCode", this.txtIsoNo.Text.Trim()));
} }
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
}
}
}
private string StatusText(int status) {
if (status == 0)
return "合格";
else
return "不合格";
} }
#region #region
@ -185,9 +213,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI
DelegationDate=x.DelegationDate, DelegationDate=x.DelegationDate,
InstallationName=n.InstallationName, InstallationName=n.InstallationName,
UnitName=y.UnitName, UnitName=y.UnitName,
DetectionMethod="待定", DetectionMethod="PMI光谱分析",
Tabler=x.Tabler, Tabler=x.Tabler,
Remark=x.Remark, Remark=x.Remark,
DetectionStandard=x.DetectionStandard,
}).ToList(); }).ToList();
if (pageInfo.Count>0) if (pageInfo.Count>0)
{ {
@ -198,6 +227,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod; this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod;
this.txtTabler.Text = pageInfo[0].Tabler; this.txtTabler.Text = pageInfo[0].Tabler;
this.txtRemark.Text = pageInfo[0].Remark; this.txtRemark.Text = pageInfo[0].Remark;
this.txtDetectionStandard.Text= pageInfo[0].DetectionStandard;
} }
} }
#endregion #endregion
@ -214,6 +244,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.txtDetectionMethod.Text = string.Empty; this.txtDetectionMethod.Text = string.Empty;
this.txtTabler.Text = string.Empty; this.txtTabler.Text = string.Empty;
this.txtRemark.Text = string.Empty; this.txtRemark.Text = string.Empty;
this.txtDetectionStandard.Text = string.Empty;
} }
#endregion #endregion

View File

@ -221,6 +221,33 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// </remarks> /// </remarks>
protected global::FineUIPro.Grid Grid1; protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// txtIsoNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtIsoNo;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>