From 43af2f9d10078df8a9dab812847247b5e0817501 Mon Sep 17 00:00:00 2001 From: LiJiaWen Date: Tue, 2 Sep 2025 15:21:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8C=E4=B8=9A=E4=BD=93=E6=A3=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=92=8C=E4=B8=80=E4=BA=9BBUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.新增登记信息窗口更换接害因素选择组件, 增加了搜索功能 2.新增登记信息窗口在修改人员信息时, 不再根据接害因素修改登记项目 3.删除登记项目时, 判断PACS项目是否已经在PACS系统登记的逻辑修正 4.分检界面的审核按钮, 判断LIS项目未在LIS数据库查询到结果后, 不再强制阻止审核步骤 5.职业报告生成时, 如果问诊信息缺失, 增加准确的用户提示弹窗 --- PEIS/Utils/ReportHelper.cs | 5 + PEIS/View/Enrollment/EnrollmentOrgForm.cs | 81 +++--- PEIS/View/Enrollment/EnrollmentPersonForm.cs | 44 +-- .../NewEnrollmentPersonForm.Designer.cs | 84 ++++-- .../Enrollment/NewEnrollmentPersonForm.cs | 263 +++++++++++++----- .../Enrollment/NewEnrollmentPersonForm.resx | 9 - PEIS/View/Exam/PartForm.cs | 7 +- 7 files changed, 334 insertions(+), 159 deletions(-) diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs index 7fb5eac..82d2a91 100644 --- a/PEIS/Utils/ReportHelper.cs +++ b/PEIS/Utils/ReportHelper.cs @@ -257,6 +257,11 @@ namespace PEIS.Utils var examCareerConclusions = new TotalModel().GetExamCareerConclusion(eid); + if (!lstSymptom.Any() || examCareerHisInq == null) + { + throw new Exception("未查询到该人员问诊数据!"); + } + // 基础信息 if (patient.OEID != null) { diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index 239371d..9de4c70 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -280,7 +280,7 @@ namespace PEIS.View.Enrollment if (Convert.ToBoolean(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "IsOccupational"))) { - + JobStatusCol.Visible = true; JobStatusCol.VisibleIndex = 7; @@ -371,7 +371,7 @@ namespace PEIS.View.Enrollment // if (IsOccupational && item.Type != null && item.Type.Contains("职业")) { - if(string.IsNullOrEmpty(item.JobStatus) || string.IsNullOrEmpty(item.HazardFactors)) + if (string.IsNullOrEmpty(item.JobStatus) || string.IsNullOrEmpty(item.HazardFactors)) { Global.Msg("info", $@"请选择{item.Name}分组,在岗情况或接害因素"); return; @@ -379,7 +379,7 @@ namespace PEIS.View.Enrollment } item.Sex = item.Sex == null ? "0" : item.Sex.Equals("男") ? "1" : item.Sex.Equals("女") ? "2" : "0"; - if(item.ID != 0) + if (item.ID != 0) { var _list = DAOHelp.GetDataBySQL($@"SELECT * FROM Enrollment_OrgGroup WHERE ID = {item.ID}"); var _lItem = _list.Count() == 0 ? null : _list[0]; @@ -389,7 +389,7 @@ namespace PEIS.View.Enrollment } else { - item.Save(); + item.Save(); } } OnGetEnrollmentOrgGroup(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString())); @@ -687,7 +687,9 @@ namespace PEIS.View.Enrollment { if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return; var item = DgvEnrollmentFeeItem.GetRow(DgvEnrollmentFeeItem.GetSelectedRows()[0]) as EnrollmentFeeItem; - if (item?.OrderNo != null) + if (item == null) return; + item.GetById(); + if (item.OrderNo != null) { Global.Msg("info", "已生成订单不可取消!"); return; @@ -696,11 +698,11 @@ namespace PEIS.View.Enrollment if (DgvEnrollmentFeeItem.FocusedColumn.ToString() == "套餐" && item.PackId != null) { if (Global.Msg("warn", "确定移除当前套餐吗?") == DialogResult.No) return; - List _packCheckFeeItem = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item?.EID)} and PackID = {Convert.ToInt64(item?.PackId)} and ItemClass = '检查'"); + List _packCheckFeeItem = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item.EID)} and PackID = {Convert.ToInt64(item.PackId)} and ItemClass = '检查'"); bool _isPacsRegist = false; foreach (EnrollmentFeeItem _feeItem in _packCheckFeeItem) { - System.Data.DataTable dataTable = DAOHelp.GetDataBySQL($@"select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = {_feeItem.ID}"); + System.Data.DataTable dataTable = DAOHelp.GetDataBySQL($@"select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = {_feeItem.ID} and DelDate is NULL"); if (dataTable.Rows.Count > 0) { _isPacsRegist = true; @@ -712,22 +714,26 @@ namespace PEIS.View.Enrollment Global.Msg("info", "套餐中的检查项目已在PACS系统登记完成,不能删除!"); return; } - OnDelItemByPackId(1, Convert.ToInt64(item?.EID), Convert.ToInt64(item?.PackId)); + OnDelItemByPackId(1, Convert.ToInt64(item.EID), Convert.ToInt64(item.PackId)); OnGetEnrollmentFeeItem(_chooseRegItem.ID); + //记录日志 + new Log($@"移除套餐登记:体检号={item.EID},套餐ID={item.PackId}, 套餐名称={item.PackId}", "3").Save(); return; } // 检查项目是否已经登记,登记后无法删除 if (item.ItemClass == "检查") { - List _isPacsRegistes = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID)"); + List _isPacsRegistes = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID and DelDate is NULL)"); if (_isPacsRegistes.Count > 0) { Global.Msg("info", "检查项目已在PACS系统登记完成,不能删除!"); return; } } - item?.Delete(); + item.Delete(); OnGetEnrollmentFeeItem(_chooseRegItem.ID); + //记录日志 + new Log($@"移除项目登记:体检号={item.EID},项目ID={item.FeeItemCode}, 项目名称={item.FeeItemName}", "3").Save(); } } @@ -878,7 +884,7 @@ namespace PEIS.View.Enrollment try { var items = new List(); - _lstEnrollmentFeeItem.Where(w => w.OrderNo != null && !w.IsHide ).GroupBy(g => g.DeptCode).ForEach(dept => + _lstEnrollmentFeeItem.Where(w => w.OrderNo != null && !w.IsHide).GroupBy(g => g.DeptCode).ForEach(dept => { var item = new EnrollmentFeeItem() { @@ -969,7 +975,7 @@ namespace PEIS.View.Enrollment return; } - if(_lstGroupPatient.Where(w => w.PID == item?.ID).ToList().Count != 0) + if (_lstGroupPatient.Where(w => w.PID == item?.ID).ToList().Count != 0) { Global.Msg("info", "该成员已应用到分组!"); return; @@ -1050,7 +1056,7 @@ namespace PEIS.View.Enrollment private void NameSearch_KeyDown(object sender, KeyEventArgs e) // 模糊检索 { if (e.KeyCode == Keys.Enter) - OnGetEnrollmentOrg(DtpBegDate.Value, DtpEndDate.Value, NameSearch.Text); + OnGetEnrollmentOrg(DtpBegDate.Value, DtpEndDate.Value, NameSearch.Text); } private void FeeItemSearch_TextChanged(object sender, EventArgs e) // 收费项目检索 @@ -1108,7 +1114,7 @@ namespace PEIS.View.Enrollment var reportFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "OrgExcel.frx"); rpt.Load(reportFile); - + rpt.SetParameterValue("TotalCount", _lstExcelEPatient.Count()); rpt.SetParameterValue("No", _lstExcelEPatient.Where(w => w.SignTime == null).ToList().Count()); rpt.SetParameterValue("Yes", _lstExcelEPatient.Where(w => w.SignTime != null).ToList().Count()); @@ -1272,7 +1278,7 @@ namespace PEIS.View.Enrollment return; } DialogResult delConfirm = MessageBox.Show($"确定删除成员【{item.Name}】的收费项目信息并剔除分组?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); - if(delConfirm == DialogResult.OK) + if (delConfirm == DialogResult.OK) { OnCancelRegInfo(item); OnGetOrgPatient(); @@ -1476,7 +1482,7 @@ namespace PEIS.View.Enrollment return; } - if(item?.CancelTime != null) + if (item?.CancelTime != null) { Global.Msg("info", "该订单为退费订单留存记录,不能删除!"); return; @@ -1727,16 +1733,20 @@ namespace PEIS.View.Enrollment { if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return; if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return; - if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0) - { - Global.Msg("info", "没有要处理的收费项目!"); - return; - } - if (_lstEnrollmentFeeItem.Where(w => w.OEID != null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count()) + if (Global._hospital.Name == "德宏州中医医院") { - Global.Msg("info", "未处理体检项目无个人项目,请选择统一收费!"); - return; + if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0) + { + Global.Msg("info", "没有要处理的收费项目!"); + return; + } + + if (_lstEnrollmentFeeItem.Where(w => w.OEID != null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count()) + { + Global.Msg("info", "未处理体检项目无个人项目,请选择统一收费!"); + return; + } } if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return; @@ -1751,16 +1761,19 @@ namespace PEIS.View.Enrollment if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return; if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return; - if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0) + if (Global._hospital.Name == "德宏州中医医院") { - Global.Msg("info", "没有要处理的收费项目!"); - return; - } + if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0) + { + Global.Msg("info", "没有要处理的收费项目!"); + return; + } - if (_lstEnrollmentFeeItem.Where(w => w.OEID == null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count()) - { - Global.Msg("info", "未处理体检项目无团体项目,请选择个人收费!"); - return; + if (_lstEnrollmentFeeItem.Where(w => w.OEID == null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count()) + { + Global.Msg("info", "未处理体检项目无团体项目,请选择个人收费!"); + return; + } } if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return; @@ -1958,7 +1971,7 @@ namespace PEIS.View.Enrollment { var oEid = patient.OEID == null ? 0 : (long)patient.OEID; var pid = patient.PID == null ? 0 : (long)patient.PID; - var groupId = patient.GroupID == null ? 0 : (long)patient.GroupID; + var groupId = patient.GroupID == null ? 0 : (long)patient.GroupID; CancelRegInfo?.Invoke(this, new Args { ID = patient.ID, OEID = oEid, Name = patient.Name, Pid = pid, GroupID = groupId }); } @@ -2223,7 +2236,7 @@ namespace PEIS.View.Enrollment DgcEnrollmentFeeItem.DataSource = _lstEnrollmentFeeItem; DgvEnrollmentFeeItem.BestFitColumns(); DgvEnrollmentFeeItem.ExpandAllGroups(); - + } public void ShowCheckCost(List items) diff --git a/PEIS/View/Enrollment/EnrollmentPersonForm.cs b/PEIS/View/Enrollment/EnrollmentPersonForm.cs index 73b3cc0..b576b17 100644 --- a/PEIS/View/Enrollment/EnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/EnrollmentPersonForm.cs @@ -502,7 +502,8 @@ namespace PEIS.View.Enrollment if (!eInfo.InRowCell) return; EnrollmentFeeItem item = DgvEFeeItem.GetRow(DgvEFeeItem.GetSelectedRows()[0]) as EnrollmentFeeItem; - + if (item == null) return; + item.GetById(); if (item.OrderNo != null) { Global.Msg("info", "已生成订单不可取消!"); @@ -518,11 +519,11 @@ namespace PEIS.View.Enrollment if (DgvEFeeItem.FocusedColumn.ToString() == "套餐" && item.PackId != null) { if (Global.Msg("warn", "确定移除当前套餐吗?") == DialogResult.No) return; - List _packCheckFeeItem = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item?.EID)} and PackID = {Convert.ToInt64(item?.PackId)} and ItemClass = '检查'"); + List _packCheckFeeItem = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item.EID)} and PackID = {Convert.ToInt64(item.PackId)} and ItemClass = '检查'"); bool _isPacsRegist = false; - foreach(EnrollmentFeeItem _feeItem in _packCheckFeeItem) + foreach (EnrollmentFeeItem _feeItem in _packCheckFeeItem) { - System.Data.DataTable dataTable = DAOHelp.GetDataBySQL($@"select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = {_feeItem.ID}"); + System.Data.DataTable dataTable = DAOHelp.GetDataBySQL($@"select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = {_feeItem.ID} and DelDate is NULL"); if (dataTable.Rows.Count > 0) { _isPacsRegist = true; @@ -534,15 +535,17 @@ namespace PEIS.View.Enrollment Global.Msg("info", "套餐中的检查项目已在PACS系统登记完成,不能删除!"); return; } - OnDelItemByPackId(Convert.ToInt64(item?.EID), Convert.ToInt64(item?.PackId)); + OnDelItemByPackId(Convert.ToInt64(item.EID), Convert.ToInt64(item.PackId)); OnGetExamFeeItem(_chooseRegItem.ID, "0"); + //记录日志 + new Log($@"移除套餐登记:体检号={item.EID},套餐ID={item.PackId}, 套餐名称={item.PackId}", "3").Save(); return; } // 检查项目是否已经登记,登记后无法删除 if (item.ItemClass == "检查") { - List _isPacsRegistes = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID)"); + List _isPacsRegistes = DAOHelp.GetDataBySQL($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID and DelDate is NULL)"); if (_isPacsRegistes.Count > 0) { Global.Msg("info", "检查项目已在PACS系统登记完成,不能删除!"); @@ -551,6 +554,8 @@ namespace PEIS.View.Enrollment } item.Delete(); OnGetExamFeeItem(_chooseRegItem.ID, "0"); + //记录日志 + new Log($@"移除项目登记:体检号={item.EID},项目ID={item.FeeItemCode}, 项目名称={item.FeeItemName}", "3").Save(); } private void TsmiProjectPrintGuide_Click(object sender, EventArgs e) @@ -570,17 +575,17 @@ namespace PEIS.View.Enrollment try { var items = new List(); - _lstEFeeItem.Where(w => w.OrderNo != null && !w.IsHide ).GroupBy(g => g.DeptCode).ForEach(dept => - { - var item = new EnrollmentFeeItem() - { - DeptName = dept.FirstOrDefault()?.DeptName, - FeeItemName = string.Join(@"、", dept.Select(s => s.FeeItemName).ToList()), - Address = dept.FirstOrDefault()?.Address, - DeptTips = dept.FirstOrDefault()?.DeptTips - }; - items.Add(item); - }); + _lstEFeeItem.Where(w => w.OrderNo != null && !w.IsHide).GroupBy(g => g.DeptCode).ForEach(dept => + { + var item = new EnrollmentFeeItem() + { + DeptName = dept.FirstOrDefault()?.DeptName, + FeeItemName = string.Join(@"、", dept.Select(s => s.FeeItemName).ToList()), + Address = dept.FirstOrDefault()?.Address, + DeptTips = dept.FirstOrDefault()?.DeptTips + }; + items.Add(item); + }); pReport = ReportHelper.PrintGuide(items, _chooseRegItem); pReport.Show(); @@ -832,7 +837,8 @@ namespace PEIS.View.Enrollment public event EventHandler> GetRegItems; public void ShowRegItems(List items, int code) { - if (code == 0) { + if (code == 0) + { items.ForEach(a => a.Sex = a.Sex.Equals("1") ? "男" : a.Sex.Equals("2") ? "女" : ""); Invoke(new Action(() => _lstRegItems = items)); Invoke(new Action(() => DgcRegItem.DataSource = null)); @@ -860,7 +866,7 @@ namespace PEIS.View.Enrollment Invoke(new Action(() => { DgcRegItem2.DataSource = _lstRegItems2.Where(a => a?.Name.Contains(NameSearch2.Text) == true || a?.ID.ToString().Contains(NameSearch2.Text) == true || a?.SpellCode?.Contains(NameSearch2.Text) == true); })); if (_lstRegItems2.Where(a => a?.Name.Contains(NameSearch2.Text) == true || a?.ID.ToString().Contains(NameSearch2.Text) == true).Count() == 0) DgcCopyItem.DataSource = _lstCopyFeeItem = null; } - + DgvRegItem.ExpandAllGroups(); Invoke(new Action(() => { DgvRegItem.BestFitColumns(); DgvRegItem2.BestFitColumns(); })); } diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs index 1b24145..d553959 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs @@ -78,14 +78,21 @@ this.JobStatusComboBox = new System.Windows.Forms.ComboBox(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); - this.HazardFactorsComboBox = new DevExpress.XtraEditors.CheckedComboBoxEdit(); this.label11 = new System.Windows.Forms.Label(); this.WorkYears = new System.Windows.Forms.TextBox(); this.CompanyTxtBox = new System.Windows.Forms.ComboBox(); this.NationBoxTxt = new System.Windows.Forms.ComboBox(); + this.HazardFactorsEdit = new DevExpress.XtraEditors.PopupContainerEdit(); + this.HazardFactorsDataControl = new DevExpress.XtraEditors.PopupContainerControl(); + this.HazardFactorsCheckedListBoxControl = new DevExpress.XtraEditors.CheckedListBoxControl(); + this.HazardFactorsFilter = new DevExpress.XtraEditors.SearchControl(); ((System.ComponentModel.ISupportInitialize)(this.Photo)).BeginInit(); this.SexGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsComboBox.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsEdit.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsDataControl)).BeginInit(); + this.HazardFactorsDataControl.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsCheckedListBoxControl)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsFilter.Properties)).BeginInit(); this.SuspendLayout(); // // label4 @@ -623,23 +630,6 @@ this.label10.TabIndex = 124; this.label10.Text = "在岗情况"; // - // HazardFactorsComboBox - // - this.HazardFactorsComboBox.EditValue = ((object)(resources.GetObject("HazardFactorsComboBox.EditValue"))); - this.HazardFactorsComboBox.Enabled = false; - this.HazardFactorsComboBox.Location = new System.Drawing.Point(85, 509); - this.HazardFactorsComboBox.Name = "HazardFactorsComboBox"; - this.HazardFactorsComboBox.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.HazardFactorsComboBox.Properties.Appearance.Options.UseFont = true; - this.HazardFactorsComboBox.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { - new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.HazardFactorsComboBox.Properties.EditValueType = DevExpress.XtraEditors.Repository.EditValueTypeCollection.List; - this.HazardFactorsComboBox.Properties.IncrementalSearch = true; - this.HazardFactorsComboBox.Properties.SelectAllItemCaption = "(全选)"; - this.HazardFactorsComboBox.Properties.SeparatorChar = ';'; - this.HazardFactorsComboBox.Size = new System.Drawing.Size(437, 24); - this.HazardFactorsComboBox.TabIndex = 14; - // // label11 // this.label11.AutoSize = true; @@ -679,6 +669,48 @@ this.NationBoxTxt.Size = new System.Drawing.Size(175, 25); this.NationBoxTxt.TabIndex = 131; // + // HazardFactorsEdit + // + this.HazardFactorsEdit.Location = new System.Drawing.Point(84, 509); + this.HazardFactorsEdit.Name = "HazardFactorsEdit"; + this.HazardFactorsEdit.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.HazardFactorsEdit.Properties.PopupControl = this.HazardFactorsDataControl; + this.HazardFactorsEdit.Properties.ShowPopupCloseButton = false; + this.HazardFactorsEdit.Size = new System.Drawing.Size(437, 20); + this.HazardFactorsEdit.TabIndex = 132; + // + // HazardFactorsDataControl + // + this.HazardFactorsDataControl.Controls.Add(this.HazardFactorsCheckedListBoxControl); + this.HazardFactorsDataControl.Controls.Add(this.HazardFactorsFilter); + this.HazardFactorsDataControl.Location = new System.Drawing.Point(528, 586); + this.HazardFactorsDataControl.Name = "HazardFactorsDataControl"; + this.HazardFactorsDataControl.Size = new System.Drawing.Size(436, 131); + this.HazardFactorsDataControl.TabIndex = 133; + // + // HazardFactorsCheckedListBoxControl + // + this.HazardFactorsCheckedListBoxControl.CheckOnClick = true; + this.HazardFactorsCheckedListBoxControl.Cursor = System.Windows.Forms.Cursors.Default; + this.HazardFactorsCheckedListBoxControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.HazardFactorsCheckedListBoxControl.Location = new System.Drawing.Point(0, 20); + this.HazardFactorsCheckedListBoxControl.Name = "HazardFactorsCheckedListBoxControl"; + this.HazardFactorsCheckedListBoxControl.SelectionMode = System.Windows.Forms.SelectionMode.None; + this.HazardFactorsCheckedListBoxControl.Size = new System.Drawing.Size(436, 111); + this.HazardFactorsCheckedListBoxControl.TabIndex = 2; + // + // HazardFactorsFilter + // + this.HazardFactorsFilter.Dock = System.Windows.Forms.DockStyle.Top; + this.HazardFactorsFilter.Location = new System.Drawing.Point(0, 0); + this.HazardFactorsFilter.Name = "HazardFactorsFilter"; + this.HazardFactorsFilter.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Repository.ClearButton()}); + this.HazardFactorsFilter.Properties.ShowSearchButton = false; + this.HazardFactorsFilter.Size = new System.Drawing.Size(436, 20); + this.HazardFactorsFilter.TabIndex = 3; + // // NewEnrollmentPersonForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); @@ -687,11 +719,12 @@ this.AutoSize = true; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(972, 723); + this.Controls.Add(this.HazardFactorsDataControl); + this.Controls.Add(this.HazardFactorsEdit); this.Controls.Add(this.NationBoxTxt); this.Controls.Add(this.CompanyTxtBox); this.Controls.Add(this.WorkYears); this.Controls.Add(this.label11); - this.Controls.Add(this.HazardFactorsComboBox); this.Controls.Add(this.HazardYears); this.Controls.Add(this.JobTypes); this.Controls.Add(this.label7); @@ -748,7 +781,11 @@ ((System.ComponentModel.ISupportInitialize)(this.Photo)).EndInit(); this.SexGroupBox.ResumeLayout(false); this.SexGroupBox.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsComboBox.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsEdit.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsDataControl)).EndInit(); + this.HazardFactorsDataControl.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsCheckedListBoxControl)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.HazardFactorsFilter.Properties)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -805,10 +842,13 @@ private System.Windows.Forms.ComboBox JobStatusComboBox; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; - private DevExpress.XtraEditors.CheckedComboBoxEdit HazardFactorsComboBox; private System.Windows.Forms.Label label11; private System.Windows.Forms.TextBox WorkYears; private System.Windows.Forms.ComboBox CompanyTxtBox; private System.Windows.Forms.ComboBox NationBoxTxt; + private DevExpress.XtraEditors.PopupContainerEdit HazardFactorsEdit; + private DevExpress.XtraEditors.PopupContainerControl HazardFactorsDataControl; + private DevExpress.XtraEditors.CheckedListBoxControl HazardFactorsCheckedListBoxControl; + private DevExpress.XtraEditors.SearchControl HazardFactorsFilter; } } \ No newline at end of file diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs index ad62cc1..c003520 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs @@ -1,4 +1,5 @@ using AForge.Video.DirectShow; +using DevExpress.XtraEditors.Controls; using PEIS.Base; using PEIS.Entity; using PEIS.Event; @@ -26,6 +27,7 @@ namespace PEIS.View.Enrollment private readonly EnrollmentPatient _regInfo = null; private BasePatient _baseInfo = null; private FilterInfoCollection videoDevices; + private List _hazardFactors; public NewEnrollmentPersonForm(EnrollmentPatient item, bool editStatus) { @@ -84,6 +86,77 @@ namespace PEIS.View.Enrollment // BirthdayDateTimePicker.Enabled = true; // CardTypeComboBox.Enabled = true; //} + + HazardFactorsEdit.Properties.BeforePopup += Properties_BeforePopup; + HazardFactorsFilter.TextChanged += HazardFactorsFilter_TextChanged; + HazardFactorsCheckedListBoxControl.ItemCheck += HazardFactorsCheckedListBoxControl_ItemCheck; + } + + private void HazardFactorsCheckedListBoxControl_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) + { + // 实时更新文本 + var selectedItems = new List(); + foreach (CheckedListBoxItem checkedItem in HazardFactorsCheckedListBoxControl.CheckedItems) + { + selectedItems.Add(checkedItem.Value.ToString()); + } + // 处理当前正在变更的项 + //var changingItem = HazardFactorsCheckedListBoxControl.Items[e.Index].Value.ToString(); + //if (e.State == CheckState.Checked) + // selectedItems.Add(changingItem); + //else + // selectedItems.Remove(changingItem); + + HazardFactorsEdit.Text = string.Join("; ", selectedItems); + } + + private void Properties_BeforePopup(object sender, EventArgs e) + { + // 1. 清空搜索框,准备新的筛选 + HazardFactorsFilter.Text = string.Empty; + + // 2. 获取当前PopupContainerEdit中已保存的选中项 + // 我们约定使用分号分隔的字符串来存储,例如 "Apple;Orange;Mango" + string currentSelectedText = HazardFactorsEdit.Text; + List currentlySelectedItems = new List(); + + if (!string.IsNullOrEmpty(currentSelectedText)) + { + // 分割字符串,移除可能存在的空字符串 + currentlySelectedItems = currentSelectedText.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) + .Select(s => s.Trim()) + .ToList(); + } + + // 3. 加载所有数据,并回显当前已选中的项 + ShowHazardFactorsData(_hazardFactors, currentlySelectedItems); + } + + private void HazardFactorsFilter_TextChanged(object sender, EventArgs e) + { + string filterText = HazardFactorsFilter.Text.Trim(); + + // 获取当前所有已选中的项,以便在筛选后保持它们的选中状态 + var currentlyCheckedItems = new List(); + foreach (CheckedListBoxItem item in HazardFactorsCheckedListBoxControl.CheckedItems) + { + currentlyCheckedItems.Add(item.Value.ToString()); + } + + // 如果搜索框为空,显示所有项 + IEnumerable itemsToShow; + if (string.IsNullOrEmpty(filterText)) + { + itemsToShow = _hazardFactors; + } + else + { + // 进行不区分大小写的包含筛选 + itemsToShow = _hazardFactors.Where(item => item.IndexOf(filterText, StringComparison.OrdinalIgnoreCase) >= 0); + } + + // 重新加载筛选后的列表,并保持之前已选中的项 + ShowHazardFactorsData(itemsToShow, currentlyCheckedItems); } private void JobStatusComboBox_SelectedIndexChanged(object sender, EventArgs e) @@ -95,12 +168,9 @@ namespace PEIS.View.Enrollment var _lst = DAOHelp.GetDataBySQL($@"SELECT Name FROM Dict_HazardType WHERE ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status}'))"); - foreach (var item in _lst) - { - HazardFactorsComboBox.Properties.Items.Add(item.Name); - } - HazardFactorsComboBox.Properties.DisplayMember = "Name"; - HazardFactorsComboBox.Properties.ValueMember = "Name"; + _hazardFactors = _lst.Select(x => x.Name).ToList(); + HazardFactorsEdit.Text = string.Empty; + ShowHazardFactorsData(_hazardFactors); } private void ExamTypeComboBox_SelectedValueChanged(object sender, EventArgs e) @@ -112,7 +182,7 @@ namespace PEIS.View.Enrollment WorkYears.Enabled = true; HazardYears.Enabled = true; JobStatusComboBox.Enabled = true; - HazardFactorsComboBox.Enabled = true; + HazardFactorsEdit.Enabled = true; } else { @@ -120,7 +190,7 @@ namespace PEIS.View.Enrollment WorkYears.Enabled = false; HazardYears.Enabled = false; JobStatusComboBox.Enabled = false; - HazardFactorsComboBox.Enabled = false; + HazardFactorsEdit.Enabled = false; } } @@ -236,13 +306,17 @@ namespace PEIS.View.Enrollment Description.Text = item?.Description; Photo.Image = Base64ToImage(item?.Photo); JobTypes.Text = item?.JobTypes; - JobStatusComboBox.SelectedValue = item?.JobStatus ?? "岗前"; + JobStatusComboBox.SelectedIndex = -1; + if (item?.JobStatus != null) + { + JobStatusComboBox.SelectedValue = item?.JobStatus; + } WorkYears.Text = item?.WorkYears; HazardYears.Text = item?.HazardYears; if (item.ExamType != null && item.ExamType.Contains("职业")) { - HazardFactorsComboBox.SetEditValue(item?.HazardFactors.Split(';').Select(s => (object)s.Trim()).ToList()); + HazardFactorsEdit.Text = item?.HazardFactors; } OnGetPid(); @@ -352,7 +426,7 @@ namespace PEIS.View.Enrollment return; } - if (string.IsNullOrEmpty(HazardFactorsComboBox.Text.Trim())) + if (string.IsNullOrEmpty(HazardFactorsEdit.Text.Trim())) { Global.Msg("err", "请选择接害因素!"); return; @@ -397,64 +471,66 @@ namespace PEIS.View.Enrollment item.WorkYears = WorkYears.Text.Trim(); item.HazardYears = HazardYears.Text.Trim(); item.JobStatus = JobStatusComboBox.SelectedValue?.ToString(); - item.HazardFactors = HazardFactorsComboBox.Text; + item.HazardFactors = HazardFactorsEdit.Text; } - var _hazardListeee = HazardFactorsComboBox.EditValue as List; - if (_editStatus) // 编辑 { item.ID = _regInfo.ID; item.PID = _regInfo?.PID; OnUpdateRegItem(item); - // 判断是否更改为职业体检 - if (ExamType != null && ExamType.Contains("职业")) - { - // 避免重复开设,删除个人所有项目 - DAOHelp.ExecuteSql($@"UPDATE Enrollment_FeeItem SET EID = -{_regInfo?.ID}, CreateTime = GETDATE(), CreatorCode = '{Global.currentUser.Code}', Creator = '{Global.currentUser.Name}', IsSend = 0 WHERE EID = {_regInfo?.ID}"); - - List _feeItemsList = new List(); + #region //编辑人员信息时不再修改项目 - // 接害类型 - var _hazardList = HazardFactorsComboBox.EditValue as List; - - foreach (var hItem in _hazardList?.Select(s => s?.ToString()).ToList()) - { - var feeItem = DAOHelp.GetDataBySQL($@"EXEC sp_HazardFactors_FeeItem '{item.JobStatus.Trim()}', '{hItem.Trim()}' "); - _feeItemsList.AddRange(feeItem); - } - - // 去除重复项 - var _distFeeItem = _feeItemsList.GroupBy(g => g.KeyNo).Select(s => s.First()).ToList(); - - foreach (var dItem in _distFeeItem) - { - EnrollmentFeeItem eItem = new EnrollmentFeeItem(); - Int32 index = 0; - - eItem.EID = _regInfo?.ID; - eItem.FID = dItem.ID; - eItem.FeeItemCode = dItem.FeeItemCode; - eItem.FeeItemName = dItem.FeeItemName; - eItem.Quantity = 1; - eItem.Unit = dItem.Unit; - eItem.Price = dItem.Price; - eItem.SettlePrice = dItem.SettlePrice; - eItem.ItemClass = dItem.ItemClass; - eItem.CreateTime = DateTime.Now; - eItem.CreatorCode = Global.currentUser.Code; - eItem.Creator = Global.currentUser.Name; - eItem.DeptCode = dItem.DeptCode; - eItem.DeptName = dItem.DeptName; - eItem.Seq = index; - eItem.KeyNo = dItem.KeyNo; - eItem.IsOccupational = true; - - eItem.Save(); - } - - } + // 判断是否更改为职业体检 + //if (ExamType != null && ExamType.Contains("职业")) + //{ + // // 避免重复开设,删除个人所有项目 + // DAOHelp.ExecuteSql($@"UPDATE Enrollment_FeeItem SET EID = -{_regInfo?.ID}, CreateTime = GETDATE(), CreatorCode = '{Global.currentUser.Code}', Creator = '{Global.currentUser.Name}', IsSend = 0 WHERE EID = {_regInfo?.ID}"); + + // List _feeItemsList = new List(); + + // // 接害类型 + // var _hazardList = HazardFactorsEdit.Text.Split(';').ToList(); + + // foreach (var hItem in _hazardList) + // { + // var feeItem = DAOHelp.GetDataBySQL($@"EXEC sp_HazardFactors_FeeItem '{item.JobStatus.Trim()}', '{hItem.Trim()}' "); + // _feeItemsList.AddRange(feeItem); + // } + + // // 去除重复项 + // var _distFeeItem = _feeItemsList.GroupBy(g => g.KeyNo).Select(s => s.First()).ToList(); + + // foreach (var dItem in _distFeeItem) + // { + // EnrollmentFeeItem eItem = new EnrollmentFeeItem(); + // Int32 index = 0; + + // eItem.EID = _regInfo?.ID; + // eItem.FID = dItem.ID; + // eItem.FeeItemCode = dItem.FeeItemCode; + // eItem.FeeItemName = dItem.FeeItemName; + // eItem.Quantity = 1; + // eItem.Unit = dItem.Unit; + // eItem.Price = dItem.Price; + // eItem.SettlePrice = dItem.SettlePrice; + // eItem.ItemClass = dItem.ItemClass; + // eItem.CreateTime = DateTime.Now; + // eItem.CreatorCode = Global.currentUser.Code; + // eItem.Creator = Global.currentUser.Name; + // eItem.DeptCode = dItem.DeptCode; + // eItem.DeptName = dItem.DeptName; + // eItem.Seq = index; + // eItem.KeyNo = dItem.KeyNo; + // eItem.IsOccupational = true; + + // eItem.Save(); + // } + + //} + + #endregion } else //新增 { @@ -476,9 +552,9 @@ namespace PEIS.View.Enrollment var EPItem = _list[0]; // 接害类型 - var _hazardList = HazardFactorsComboBox.EditValue as List; + var _hazardList = HazardFactorsEdit.Text.Split(';').ToList(); - foreach (var hItem in _hazardList?.Select(s => s?.ToString()).ToList()) + foreach (var hItem in _hazardList) { var feeItem = DAOHelp.GetDataBySQL($@"EXEC sp_HazardFactors_FeeItem '{item.JobStatus.Trim()}', '{hItem.Trim()}' "); _feeItemsList.AddRange(feeItem); @@ -797,20 +873,26 @@ namespace PEIS.View.Enrollment Console.WriteLine(items.Count); if (items.Count == 0) return; - CompanyTxtBox.BeginUpdate(); + // 更新ComboBox CompanyTxtBox.Items.Clear(); - foreach (var item in items) - { - if (string.IsNullOrEmpty(item.Name)) continue; - CompanyTxtBox.Items.Add(item.Name); - } - CompanyTxtBox.EndUpdate(); - - // 保持下拉框打开 + CompanyTxtBox.Items.AddRange(items.Select(x => x.Name).ToArray()); CompanyTxtBox.DroppedDown = true; - // 保持文本选择状态,方便继续输入 CompanyTxtBox.SelectionStart = CompanyTxtBox.Text.Length; - CompanyTxtBox.SelectionLength = 0; + + //CompanyTxtBox.BeginUpdate(); + //CompanyTxtBox.Items.Clear(); + //foreach (var item in items) + //{ + // if (string.IsNullOrEmpty(item.Name)) continue; + // CompanyTxtBox.Items.Add(item.Name); + //} + //CompanyTxtBox.EndUpdate(); + + //// 保持下拉框打开 + //CompanyTxtBox.DroppedDown = true; + //// 保持文本选择状态,方便继续输入 + //CompanyTxtBox.SelectionStart = CompanyTxtBox.Text.Length; + //CompanyTxtBox.SelectionLength = 0; } public void OnGetNationData() @@ -833,6 +915,41 @@ namespace PEIS.View.Enrollment NationBoxTxt.SelectionStart = NationBoxTxt.Text.Length; NationBoxTxt.SelectionLength = 0; } + + /// + /// 加载数据到HazardFactors,并可选择性地设置某些项为选中状态 + /// + /// 要加载的数据项 + /// 需要被选中的项(默认为null,不选中任何项) + private void ShowHazardFactorsData(IEnumerable items, IEnumerable itemsToCheck = null) + { + // 清除现有项 + HazardFactorsCheckedListBoxControl.Items.Clear(); + + // 添加已选项 + if (itemsToCheck != null) + { + foreach (var item in itemsToCheck) + { + int index = HazardFactorsCheckedListBoxControl.Items.Add(item, item); + HazardFactorsCheckedListBoxControl.SetItemChecked(index, true); + } + } + + // 添加筛选项 + foreach (var item in items) + { + if (itemsToCheck != null && itemsToCheck.Contains(item)) + { + continue; + } + else + { + int index = HazardFactorsCheckedListBoxControl.Items.Add(item, item); + HazardFactorsCheckedListBoxControl.SetItemChecked(index, false); + } + } + } #endregion } } \ No newline at end of file diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.resx b/PEIS/View/Enrollment/NewEnrollmentPersonForm.resx index b7b2951..17385d9 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.resx +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.resx @@ -166,15 +166,6 @@ z0vneXqn+xeKWaTHo2zHoue61UvidHXsIlYbiXhmRfkZvQ50rG45e5vaNJhVbojytc0PFN+jOooGOWxu 5OE2F0U5Tqu5ZXWLKCd2u9KHdW1uRDzraQXfWW0UEtg88z8VzmFzI+U73xQj7/3OmhLn2U6j/zHKO6nB SasG/xy/ANvLiZmkPPdDAAAAAElFTkSuQmCC - - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u - ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u - PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB - AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLk9iamVjdAMAAAAGX2l0 - ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgCAAAACQMAAAAAAAAAAAAAABADAAAAAAAAAAs= \ No newline at end of file diff --git a/PEIS/View/Exam/PartForm.cs b/PEIS/View/Exam/PartForm.cs index 3fa6873..dd6255b 100644 --- a/PEIS/View/Exam/PartForm.cs +++ b/PEIS/View/Exam/PartForm.cs @@ -1304,8 +1304,11 @@ namespace PEIS.View.Exam } if (!string.IsNullOrEmpty(message)) { - Global.Msg("info", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!"); - return; + DialogResult dr =Global.Msg("warn", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!\r\n如果核查无误仍要审核,请点击确定按钮。否则点击取消!"); + if (dr != DialogResult.Yes) + { + return; + } } }