职业体检优化和一些BUG修复

1.新增登记信息窗口更换接害因素选择组件, 增加了搜索功能
2.新增登记信息窗口在修改人员信息时, 不再根据接害因素修改登记项目
3.删除登记项目时, 判断PACS项目是否已经在PACS系统登记的逻辑修正
4.分检界面的审核按钮, 判断LIS项目未在LIS数据库查询到结果后, 不再强制阻止审核步骤
5.职业报告生成时, 如果问诊信息缺失, 增加准确的用户提示弹窗
dhzzyy
LiJiaWen 1 month ago
parent a8b8da97fd
commit 43af2f9d10
  1. 5
      PEIS/Utils/ReportHelper.cs
  2. 25
      PEIS/View/Enrollment/EnrollmentOrgForm.cs
  3. 18
      PEIS/View/Enrollment/EnrollmentPersonForm.cs
  4. 84
      PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs
  5. 249
      PEIS/View/Enrollment/NewEnrollmentPersonForm.cs
  6. 9
      PEIS/View/Enrollment/NewEnrollmentPersonForm.resx
  7. 5
      PEIS/View/Exam/PartForm.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)
{

@ -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<EnrollmentFeeItem> _packCheckFeeItem = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item?.EID)} and PackID = {Convert.ToInt64(item?.PackId)} and ItemClass = '检查'");
List<EnrollmentFeeItem> _packCheckFeeItem = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"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<EnrollmentFeeItem> _isPacsRegistes = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID)");
List<EnrollmentFeeItem> _isPacsRegistes = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"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();
}
}
@ -1727,6 +1733,9 @@ namespace PEIS.View.Enrollment
{
if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return;
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
if (Global._hospital.Name == "德宏州中医医院")
{
if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0)
{
Global.Msg("info", "没有要处理的收费项目!");
@ -1738,6 +1747,7 @@ namespace PEIS.View.Enrollment
Global.Msg("info", "未处理体检项目无个人项目,请选择统一收费!");
return;
}
}
if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return;
CheckCostForm checkCostForm = new CheckCostForm(0, _chooseRegItem.ID);
@ -1751,6 +1761,8 @@ namespace PEIS.View.Enrollment
if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return;
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
if (Global._hospital.Name == "德宏州中医医院")
{
if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0)
{
Global.Msg("info", "没有要处理的收费项目!");
@ -1762,6 +1774,7 @@ namespace PEIS.View.Enrollment
Global.Msg("info", "未处理体检项目无团体项目,请选择个人收费!");
return;
}
}
if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return;
CheckCostForm checkCostForm = new CheckCostForm(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), 0);

@ -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<EnrollmentFeeItem> _packCheckFeeItem = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"select * from Enrollment_FeeItem where EID = {Convert.ToInt64(item?.EID)} and PackID = {Convert.ToInt64(item?.PackId)} and ItemClass = '检查'");
List<EnrollmentFeeItem> _packCheckFeeItem = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"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;
@ -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<EnrollmentFeeItem> _isPacsRegistes = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"select * from Enrollment_FeeItem where ID = {item.ID} and EXISTS(select * from pacs.DICOMSERVER.dbo.PatientSchedule where XMNo = ID)");
List<EnrollmentFeeItem> _isPacsRegistes = DAOHelp.GetDataBySQL<EnrollmentFeeItem>($@"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)
@ -832,7 +837,8 @@ namespace PEIS.View.Enrollment
public event EventHandler<Args<dynamic>> GetRegItems;
public void ShowRegItems(List<EnrollmentPatient> 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));

@ -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;
}
}

@ -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<string> _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<string>();
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<string> currentlySelectedItems = new List<string>();
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<string>();
foreach (CheckedListBoxItem item in HazardFactorsCheckedListBoxControl.CheckedItems)
{
currentlyCheckedItems.Add(item.Value.ToString());
}
// 如果搜索框为空,显示所有项
IEnumerable<string> 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<DictHazardType>($@"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<object>;
if (_editStatus) // 编辑
{
item.ID = _regInfo.ID;
item.PID = _regInfo?.PID;
OnUpdateRegItem(item);
#region //编辑人员信息时不再修改项目
// 判断是否更改为职业体检
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}");
//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<FeeItem> _feeItemsList = new List<FeeItem>();
// List<FeeItem> _feeItemsList = new List<FeeItem>();
// 接害类型
var _hazardList = HazardFactorsComboBox.EditValue as List<object>;
// // 接害类型
// var _hazardList = HazardFactorsEdit.Text.Split(';').ToList();
foreach (var hItem in _hazardList?.Select(s => s?.ToString()).ToList())
{
var feeItem = DAOHelp.GetDataBySQL<FeeItem>($@"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 hItem in _hazardList)
// {
// var feeItem = DAOHelp.GetDataBySQL<FeeItem>($@"EXEC sp_HazardFactors_FeeItem '{item.JobStatus.Trim()}', '{hItem.Trim()}' ");
// _feeItemsList.AddRange(feeItem);
// }
foreach (var dItem in _distFeeItem)
{
EnrollmentFeeItem eItem = new EnrollmentFeeItem();
Int32 index = 0;
// // 去除重复项
// var _distFeeItem = _feeItemsList.GroupBy(g => g.KeyNo).Select(s => s.First()).ToList();
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;
// 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();
// }
eItem.Save();
}
//}
}
#endregion
}
else //新增
{
@ -476,9 +552,9 @@ namespace PEIS.View.Enrollment
var EPItem = _list[0];
// 接害类型
var _hazardList = HazardFactorsComboBox.EditValue as List<object>;
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<FeeItem>($@"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;
}
/// <summary>
/// 加载数据到HazardFactors,并可选择性地设置某些项为选中状态
/// </summary>
/// <param name="items">要加载的数据项</param>
/// <param name="itemsToCheck">需要被选中的项(默认为null,不选中任何项)</param>
private void ShowHazardFactorsData(IEnumerable<string> items, IEnumerable<string> 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
}
}

@ -166,15 +166,6 @@
z0vneXqn+xeKWaTHo2zHoue61UvidHXsIlYbiXhmRfkZvQ50rG45e5vaNJhVbojytc0PFN+jOooGOWxu
5OE2F0U5Tqu5ZXWLKCd2u9KHdW1uRDzraQXfWW0UEtg88z8VzmFzI+U73xQj7/3OmhLn2U6j/zHKO6nB
SasG/xy/ANvLiZmkPPdDAAAAAElFTkSuQmCC
</value>
</data>
<data name="HazardFactorsComboBox.EditValue" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLk9iamVjdAMAAAAGX2l0
ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgCAAAACQMAAAAAAAAAAAAAABADAAAAAAAAAAs=
</value>
</data>
</root>

@ -1304,10 +1304,13 @@ namespace PEIS.View.Exam
}
if (!string.IsNullOrEmpty(message))
{
Global.Msg("info", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!");
DialogResult dr =Global.Msg("warn", message.Substring(0, message.Length - 1) + " 等检验项目结果未出,请核查后审核!\r\n如果核查无误仍要审核,请点击确定按钮。否则点击取消!");
if (dr != DialogResult.Yes)
{
return;
}
}
}
Review?.Invoke(this, new Args<DateTime?>
{

Loading…
Cancel
Save