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

@ -42,7 +42,7 @@
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Title="检测单节点树" OnNodeCommand="tvControlItem_NodeCommand"
Height="640px" runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true"
AutoLeafIdentification="true" EnableTextSelection="true" >
AutoLeafIdentification="true" EnableTextSelection="true">
</f:Tree>
</Items>
</f:Panel>
@ -107,12 +107,23 @@
</f:Form>
</Items>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="检测单明细" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="NDEItemID" AllowCellEditing="true" AllowColumnLocking="true"
EnableColumnLines="true" ClicksToEdit="2" DataIDField="NDEItemID" AllowSorting="true"
SortField="PipelineCode,WeldJointCode" SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True">
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,HotProessTrust %>"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="ID"
AllowCellEditing="true" AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
DataIDField="ID" AllowSorting="true" SortField="PipelineCode,WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="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>
<f:RowNumberField EnablePagingNumber="true" HeaderText="<%$ Resources:Lan,SerialNumber %>"
Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
@ -132,10 +143,20 @@
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,TrustDate %>" ColumnID="ProessDate"
DataField="ProessDate" SortField="ProessDate" FieldType="Date" Renderer="Date"
<f:RenderField HeaderText="<%$ Resources:Lan,TrustDate %>" ColumnID="CreatedTime"
DataField="CreatedTime" SortField="CreatedTime" FieldType="Date" Renderer="Date"
HeaderTextAlign="Center" TextAlign="Left" Width="120px">
</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>
<Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" />

View File

@ -8,6 +8,7 @@ using System.Web;
using System.Collections;
using Model;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using FineUIPro.Web.common.ProjectSet;
namespace FineUIPro.Web.WeldingProcess.PMI
{
@ -48,8 +49,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI
{
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();
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);
@ -96,30 +95,20 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="node"></param>
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")
{
///装置
var install = (from x in Funs.DB.Project_Installation
join y in Funs.DB.PMI_Delegation on x.InstallationId equals y.InstallationId
where y.UnitId == node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId
orderby x.InstallationCode
select x).Distinct();
foreach (var q in install)
{
TreeNode newNode = new TreeNode();
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;
string unitId = node.NodeID;
var ndt = from x in Funs.DB.PMI_Delegation
where x.UnitId == unitId
&& x.ProjectId == this.CurrUser.LoginProjectId
&& x.DelegationDate >= startTime && x.DelegationDate <= endTime
&&( x.DelegationNo.Contains(searchCode)|| searchCode=="")
select x;
//if (!string.IsNullOrWhiteSpace(searchCode))
// ndt = ndt.Where(q => q.DelegationNo.Contains(searchCode));
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")
{
string strSql = string.Empty;
List<SqlParameter> listStr = new List<SqlParameter>();
this.SetTextTemp();
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
@ -185,9 +213,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI
DelegationDate=x.DelegationDate,
InstallationName=n.InstallationName,
UnitName=y.UnitName,
DetectionMethod="待定",
DetectionMethod="PMI光谱分析",
Tabler=x.Tabler,
Remark=x.Remark,
DetectionStandard=x.DetectionStandard,
}).ToList();
if (pageInfo.Count>0)
{
@ -198,6 +227,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod;
this.txtTabler.Text = pageInfo[0].Tabler;
this.txtRemark.Text = pageInfo[0].Remark;
this.txtDetectionStandard.Text= pageInfo[0].DetectionStandard;
}
}
#endregion
@ -214,6 +244,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.txtDetectionMethod.Text = string.Empty;
this.txtTabler.Text = string.Empty;
this.txtRemark.Text = string.Empty;
this.txtDetectionStandard.Text = string.Empty;
}
#endregion

View File

@ -221,6 +221,33 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// </remarks>
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>
/// ToolbarSeparator1 控件。
/// </summary>