diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index 457c2e4..1f9fded 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index baa8804..9ecdad1 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx index 0e754d0..5e21a51 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx @@ -145,17 +145,11 @@ - - - - + - - - - + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs index 7f8e72d..7c2658d 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.cs @@ -309,7 +309,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI } else { - ShowNotify(Resources.Lan.PleaseSelectModifyHotProessTrust, MessageBoxIcon.Warning); + ShowNotify("请选择要处理的PMI委托", MessageBoxIcon.Warning); } } else @@ -335,7 +335,8 @@ namespace FineUIPro.Web.WeldingProcess.PMI //删除主表数据 Funs.DB.PMI_Delegation.DeleteOnSubmit(trustManage); //删除 明细表 - + var details = Funs.DB.PMI_DelegationDetails.Where(t => t.PMIId == trustManage.Id).ToList(); + Funs.DB.PMI_DelegationDetails.DeleteAllOnSubmit(details); Funs.DB.SubmitChanges(); Alert.ShowInTop(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success); this.InitTreeMenu(); diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs index 432558e..420aa75 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegation.aspx.designer.cs @@ -257,24 +257,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI /// protected global::FineUIPro.ToolbarFill ToolbarFill2; - /// - /// tbxEditorQualityNo 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox tbxEditorQualityNo; - - /// - /// txtEditorAcceptance 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtEditorAcceptance; - /// /// ToolbarSeparator1 控件。 /// diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs index 75a6097..1a2744a 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs @@ -162,19 +162,23 @@ namespace FineUIPro.Web.WeldingProcess.PMI { weldJointIds = hdItemsString.Text.Substring(0, hdItemsString.Text.LastIndexOf('|')); - List lists = BLL.PMIDelegation_Service.GetPMI_DelegationAddItem(weldJointIds); + var lists = GetGridDataTable(weldJointIds); this.BindGrid(lists); - //获取单位 - string unitCode = Funs.DB.Base_Unit.FirstOrDefault(t => t.UnitId == drpUnitId.SelectedValue)?.UnitCode; - //获取区域code - var workdAreaIdList = lists.Select(t => t.WorkAreaId).ToList(); + if (string.IsNullOrEmpty(this.txtDelegationNo.Text)) + { + //获取单位 + string unitCode = Funs.DB.Base_Unit.FirstOrDefault(t => t.UnitId == drpUnitId.SelectedValue)?.UnitCode; + //获取区域code + var workdAreaIdList = lists.Select(t => t.WorkAreaId).ToList(); - var workAreaCode = Funs.DB.Project_WorkArea.AsQueryable().Where(t => workdAreaIdList.Contains(t.WorkAreaId)).Distinct().FirstOrDefault()?.WorkAreaCode; + var workAreaCode = Funs.DB.Project_WorkArea.AsQueryable().Where(t => workdAreaIdList.Contains(t.WorkAreaId)).Distinct().FirstOrDefault()?.WorkAreaCode; + + string perfix = string.Empty; + perfix = $"PMI-{unitCode}-{workAreaCode}-PI-"; + this.txtDelegationNo.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.PMI_Delegation", "DelegationNo", this.CurrUser.LoginProjectId, perfix); + + } - string perfix = string.Empty; - perfix = $"PMI-{unitCode}-{workAreaCode}-PI-"; - this.txtDelegationNo.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.PMI_Delegation", "DelegationNo", this.CurrUser.LoginProjectId, perfix); - } } #endregion @@ -276,7 +280,59 @@ namespace FineUIPro.Web.WeldingProcess.PMI } #endregion + #region 获取Grid里面的数据返回集合 + private List GetGridDataTable(string weldJointIds) + { + string[] arr = weldJointIds.Split('|'); + JArray mergedData = Grid1.GetMergedData(); + var result = Funs.DB.View_Pipeline_WeldJoint.Select(t => new View_PMI_DelegationDetails { + WeldJointId= t.WeldJointId, + PipelineCode= t.PipelineCode, + ProjectId= t.ProjectId, + Acceptance="", + QualityNo="", + WeldJointCode=t.WeldJointCode, + Specification=t.Specification, + MaterialCode=t.MaterialCode, + WorkAreaId=t.WorkAreaId, + Status=0, + PMIId=this.PMIDelegationId + }).Where(t => arr.Contains(t.WeldJointId)).ToList(); + result.ForEach(item => + { + item.Id = SQLHelper.GetNewID(typeof(PMI_DelegationDetails)); + }); + if (mergedData.Count == 0) + { + return result; + } + else + { + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + Model.View_PMI_DelegationDetails newTrustItem = new Model.View_PMI_DelegationDetails(); + newTrustItem.Id = values.Value("Id").ToString(); + newTrustItem.PipelineCode = values.Value("PipelineCode").ToString(); + newTrustItem.WeldJointId = values.Value("WeldJointId").ToString(); + newTrustItem.Acceptance = values.Value("Acceptance").ToString(); + newTrustItem.QualityNo = values.Value("QualityNo").ToString(); + newTrustItem.WeldJointCode = values.Value("WeldJointCode").ToString(); + newTrustItem.Specification =HttpUtility.HtmlDecode(values.Value("Specification").ToString()); + newTrustItem.MaterialCode = values.Value("MaterialCode").ToString(); + newTrustItem.Status = 0; + newTrustItem.PMIId = this.PMIDelegationId; + result.Add(newTrustItem); + } + } + + return result; + } + + #endregion + #region 收集Grid页面信息,提交明细 + /// /// 收集Grid页面信息,提交明细 /// @@ -315,28 +371,19 @@ namespace FineUIPro.Web.WeldingProcess.PMI { this.hdItemsString.Text = this.hdItemsString.Text.Substring(0, this.hdItemsString.Text.LastIndexOf('|')); } - var trust = Funs.DB.PMI_Delegation.FirstOrDefault(t=>t.Id==this.PMIDelegationId); if (Grid1.SelectedRowIndexArray.Length > 0) { - List GetHotProessTrustItem = new List(); - if (!string.IsNullOrEmpty(this.hdItemsString.Text)) - { - GetHotProessTrustItem = BLL.PMIDelegation_Service.GetPMI_DelegationAddItem(this.hdItemsString.Text); - } - else if (string.IsNullOrEmpty(this.hdItemsString.Text) && this.PMIDelegationId != null) - { - GetHotProessTrustItem = BLL.PMIDelegation_Service.GetPMI_DelegationItem(this.CurrUser.LoginProjectId, this.PMIDelegationId); - } + var listData = GetGridDataTable(""); foreach (int rowIndex in Grid1.SelectedRowIndexArray) { string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var item = GetHotProessTrustItem.FirstOrDefault(x => x.WeldJointId == rowID); + var item = listData.FirstOrDefault(x => x.WeldJointId == rowID); if (item != null) { - GetHotProessTrustItem.Remove(item); + listData.Remove(item); } } - BindGrid(GetHotProessTrustItem); + BindGrid(listData); ShowNotify(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success); } } diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx index 0e97b6c..f60120b 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx @@ -131,7 +131,7 @@ Width="50px" HeaderTextAlign="Center" TextAlign="Center" /> + TextAlign="Left" Width="200px" Locked="true"> + TextAlign="Left" Width="160px"> + TextAlign="Center" Width="160px"> @@ -152,20 +152,20 @@ DataField="Acceptance" FieldType="String" TextAlign="Left" Width="150px"> <%-- 检测日期 --%> - - + <%-- 报告日期 --%> + HeaderTextAlign="Center" TextAlign="Left" Width="120px"> - + @@ -180,7 +180,7 @@ <%-- 是否合格 --%> diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs index cce02e4..b073d35 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs @@ -217,7 +217,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI if (pageInfo.Count > 0) { this.txtDelegationNo.Text = pageInfo[0].DelegationNo; - this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString(); + this.txtDelegationDate.Text = pageInfo[0].DelegationDate.Value.ToString("yyyy-MM-dd"); this.txtInstallationName.Text = pageInfo[0].InstallationName; this.txtUnitName.Text = pageInfo[0].UnitName; this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod; @@ -349,8 +349,8 @@ namespace FineUIPro.Web.WeldingProcess.PMI if (onePMIDelegationDetails == null) continue; //检测日期(缺失) - string trustDate = values.Value("TrustDate"); - if (string.IsNullOrWhiteSpace(trustDate)) + string DelegationDate = values.Value("DelegationDate"); + if (string.IsNullOrWhiteSpace(DelegationDate)) ; else ; @@ -374,7 +374,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI this.BindGrid(); } - ShowNotify("数据保存成功!(表格数据已重新绑定)"); + ShowNotify(Resources.Lan.SaveSuccessfully, MessageBoxIcon.Success); } } } \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs index 1693b43..5734da7 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs @@ -23,12 +23,12 @@ namespace FineUIPro.Web.WeldingProcess.PMI /// protected void Page_Load(object sender, EventArgs e) { + this.UnitId = Request.Params["unitId"] ?? ""; + this.ProjectId = this.CurrUser.LoginProjectId; + this.PMIId = Request.Params["PMIId"] ?? ""; + this.weldJointIds = Request.Params["weldJointIds"] ?? ""; if (!IsPostBack) { - this.UnitId = Request.Params["unitId"] ??""; - this.ProjectId = this.CurrUser.LoginProjectId; - this.PMIId = Request.Params["PMIId"]??""; - this.weldJointIds = Request.Params["weldJointIds"] ?? ""; this.InitTreeMenu();//加载树 this.BindGrid(); } @@ -127,32 +127,12 @@ namespace FineUIPro.Web.WeldingProcess.PMI select b.JointId ).Distinct().ToList(); - // string sql = @"SELECT WeldJointId,ProjectId,PipelineId,WeldJointCode,WPQCode,DetectionType, - // convert(int,dbo.Fun_GetParseInt(WeldJointCode)) AS ConvertJointNo, - //dbo.Fun_GetParseString(WeldJointCode) AS PreJotNo, - // PipingClassCode,PipeSegment,JointAttribute,PageNum, - // ComponentsCode1,ComponentsCode2,Is_hjName,IsHotProessStr,Material1Code,Material2Code, - // WeldTypeCode,Specification,HeartNo1,HeartNo2,Size,Dia,Thickness,GrooveTypeCode, - // WeldingMethodCode,WeldSilkId,WeldMatCode,WeldingDate,WeldingDailyCode,DoneDin, - // BackingWelderCode,CoverWelderCode,SystemNumber,TestPackageNo,Remark, - // MaterialCode,WeldingDate, - // (CASE WHEN IsCancel=1 THEN '是' ELSE '否' END) AS IsCancel,isPMI - // FROM View_Pipeline_WeldJoint WHERE isPMI=1 "; - - - // List paramsList = new List(); - // if (!string.IsNullOrEmpty(this.txtJointNo.Text)) - // { - // sql += @" and WeldJointCode=@WeldJointCode"; - // paramsList.Add(new SqlParameter("@WeldJointCode", txtJointNo.Text.Trim())); - // } - // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - // { - // sql += @" and PipelineId=@PipelineId "; - // paramsList.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID)); - // } - // var dt = SQLHelper.GetDataTableRunText(sql, paramsList.ToArray()); + string[] arr = this.weldJointIds.Split('|'); var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true); + if (arr.Length > 0) + { + listData.Add(arr[0]); + } if (listData.Count > 0) { query = query.Where(t => !listData.Contains(t.WeldJointId)); @@ -165,7 +145,14 @@ namespace FineUIPro.Web.WeldingProcess.PMI { query = query.Where(t => t.PipelineId == this.tvControlItem.SelectedNodeID); } - Grid1.DataSource = query.ToList(); + var data= query.ToList() ; + if (!string.IsNullOrEmpty(weldJointIds)) + { + string[] jots = weldJointIds.Split('|'); + data = data.Where(t => !jots.Contains(t.WeldJointId)).ToList(); + } + data = data.OrderBy(t => t.WeldJointCode).ToList(); + Grid1.DataSource = data; Grid1.DataBind(); } #endregion