diff --git a/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs b/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs index 6a3d712..8ab2cd9 100644 --- a/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs @@ -34,8 +34,8 @@ namespace PEIS.Model.Enrollment public List GetCheckCost(Int64 oeID, Int64 enrollmentID) { - var team = DAOHelp.GetDataBySQL($"Select a.*,b.Name from Enrollment_CheckCost a LEFT JOIN dbo.Enrollment_Patient b ON a.EID = b.ID Where a.OEID = {oeID} AND DeleteTime is null"); - var person = DAOHelp.GetDataBySQL($"Select a.*,b.Name from Enrollment_CheckCost a LEFT JOIN dbo.Enrollment_Patient b ON a.EID = b.ID Where EID = {enrollmentID} AND DeleteTime is null"); + var team = DAOHelp.GetDataBySQL($"Select a.*,b.Name from Enrollment_CheckCost a LEFT JOIN dbo.Enrollment_Patient b ON a.EID = b.ID Where a.OEID = {oeID} AND DeleteTime is null AND CancelTime is null"); + var person = DAOHelp.GetDataBySQL($"Select a.*,b.Name from Enrollment_CheckCost a LEFT JOIN dbo.Enrollment_Patient b ON a.EID = b.ID Where EID = {enrollmentID} AND DeleteTime is null AND CancelTime is null"); return team.Concat(person).GroupBy(g => g.ID).Select(s => s.First()).ToList(); } diff --git a/PEIS/ReportFiles/CATReport.frx b/PEIS/ReportFiles/CATReport.frx index eaf4fb2..4d17465 100644 --- a/PEIS/ReportFiles/CATReport.frx +++ b/PEIS/ReportFiles/CATReport.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -50,7 +50,7 @@ namespace FastReport - + @@ -80,7 +80,7 @@ namespace FastReport - + @@ -115,7 +115,7 @@ namespace FastReport - + @@ -144,7 +144,7 @@ namespace FastReport - + diff --git a/PEIS/View/EReport/TeamReportForm.cs b/PEIS/View/EReport/TeamReportForm.cs index 450b314..6dfac11 100644 --- a/PEIS/View/EReport/TeamReportForm.cs +++ b/PEIS/View/EReport/TeamReportForm.cs @@ -299,7 +299,7 @@ namespace PEIS.View.EReport { var total = DAOHelp.GetDataBySQL($@"SELECT ID,Name,HazardFactors FROM Enrollment_Patient WHERE OEID = {_regInfo.ID} AND HazardFactors LIKE '%{item}%'").Count; var sign = DAOHelp.GetDataBySQL($@"SELECT ID,Name,HazardFactors FROM Enrollment_Patient WHERE OEID = {_regInfo.ID} AND HazardFactors LIKE '%{item}%' AND SignTime IS NOT NULL").Count; - var percent = Math.Round((double)sign / (double)total, 2); + var percent = Math.Round((double)sign / (double)total, 2) * 100; foreach (var hazard in _lsthazard.Where(w => w.Name == item)) { diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs index 771ee49..8529992 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs @@ -28,7 +28,6 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EnrollmentOrgForm)); DevExpress.XtraGrid.GridFormatRule gridFormatRule1 = new DevExpress.XtraGrid.GridFormatRule(); DevExpress.XtraEditors.FormatConditionRuleExpression formatConditionRuleExpression1 = new DevExpress.XtraEditors.FormatConditionRuleExpression(); @@ -68,7 +67,7 @@ this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage(); this.DgcGroupPatient = new DevExpress.XtraGrid.GridControl(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(); this.FastGroupMove = new System.Windows.Forms.ToolStripMenuItem(); this.DgvGroupPatient = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridColumn32 = new DevExpress.XtraGrid.Columns.GridColumn(); @@ -128,7 +127,6 @@ this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn(); this.RiCmbExamType = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); this.JobTypesCol = new DevExpress.XtraGrid.Columns.GridColumn(); - this.RiCmbJobTypes = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); this.JobStatusCol = new DevExpress.XtraGrid.Columns.GridColumn(); this.RiCmbJobStatus = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); this.HazardFactorsCol = new DevExpress.XtraGrid.Columns.GridColumn(); @@ -137,6 +135,7 @@ this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn18 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.RiCmbJobTypes = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); this.panel3 = new System.Windows.Forms.Panel(); this.OpsGroup = new PEIS.View.UControl.OpMenuSimple(); this.TpGroupFeeItem = new DevExpress.XtraTab.XtraTabPage(); @@ -207,7 +206,7 @@ this.xtraTabControl4 = new DevExpress.XtraTab.XtraTabControl(); this.xtraTabPage4 = new DevExpress.XtraTab.XtraTabPage(); this.DgcCheckCost2 = new DevExpress.XtraGrid.GridControl(); - this.PersonCostFastMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.PersonCostFastMenu = new System.Windows.Forms.ContextMenuStrip(); this.PFastCharge = new System.Windows.Forms.ToolStripMenuItem(); this.PFastAllCharge = new System.Windows.Forms.ToolStripMenuItem(); this.PFastDeleteCost = new System.Windows.Forms.ToolStripMenuItem(); @@ -238,7 +237,7 @@ this.xtraTabControl3 = new DevExpress.XtraTab.XtraTabControl(); this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); this.DgcCheckCost = new DevExpress.XtraGrid.GridControl(); - this.TeamCostFastMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.TeamCostFastMenu = new System.Windows.Forms.ContextMenuStrip(); this.TFastCharge = new System.Windows.Forms.ToolStripMenuItem(); this.TFastAllCharge = new System.Windows.Forms.ToolStripMenuItem(); this.TFastDeleteCost = new System.Windows.Forms.ToolStripMenuItem(); @@ -329,7 +328,7 @@ this.splitterControl1 = new DevExpress.XtraEditors.SplitterControl(); this.panel11 = new System.Windows.Forms.Panel(); this.DgcEnrollment = new DevExpress.XtraGrid.GridControl(); - this.InfoFastMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.InfoFastMenu = new System.Windows.Forms.ContextMenuStrip(); this.FastCamera = new System.Windows.Forms.ToolStripMenuItem(); this.FastDelete = new System.Windows.Forms.ToolStripMenuItem(); this.FastExport = new System.Windows.Forms.ToolStripMenuItem(); @@ -413,9 +412,9 @@ ((System.ComponentModel.ISupportInitialize)(this.RiCmbSex)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbMarriage)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbExamType)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobTypes)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobStatus)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbHazardFactors)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobTypes)).BeginInit(); this.panel3.SuspendLayout(); this.TpGroupFeeItem.SuspendLayout(); this.panel5.SuspendLayout(); @@ -1784,9 +1783,13 @@ this.gridColumn10.AppearanceCell.Font = new System.Drawing.Font("微软雅黑", 12F); this.gridColumn10.AppearanceCell.Options.UseFont = true; this.gridColumn10.Caption = "体检类型"; - this.gridColumn10.ColumnEdit = this.RiCmbExamType; this.gridColumn10.FieldName = "Type"; this.gridColumn10.Name = "gridColumn10"; + this.gridColumn10.OptionsColumn.AllowEdit = false; + this.gridColumn10.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn10.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn10.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn10.OptionsColumn.ReadOnly = true; this.gridColumn10.OptionsFilter.AllowFilter = false; this.gridColumn10.Visible = true; this.gridColumn10.VisibleIndex = 5; @@ -1804,19 +1807,11 @@ this.JobTypesCol.AppearanceCell.Font = new System.Drawing.Font("微软雅黑", 12F); this.JobTypesCol.AppearanceCell.Options.UseFont = true; this.JobTypesCol.Caption = "工种"; - this.JobTypesCol.ColumnEdit = this.RiCmbJobTypes; this.JobTypesCol.FieldName = "JobTypes"; this.JobTypesCol.Name = "JobTypesCol"; this.JobTypesCol.OptionsFilter.AllowFilter = false; this.JobTypesCol.Width = 90; // - // RiCmbJobTypes - // - this.RiCmbJobTypes.AutoHeight = false; - this.RiCmbJobTypes.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { - new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.RiCmbJobTypes.Name = "RiCmbJobTypes"; - // // JobStatusCol // this.JobStatusCol.AppearanceCell.Font = new System.Drawing.Font("微软雅黑", 12F); @@ -1918,6 +1913,13 @@ this.gridColumn18.VisibleIndex = 9; this.gridColumn18.Width = 40; // + // RiCmbJobTypes + // + this.RiCmbJobTypes.AutoHeight = false; + this.RiCmbJobTypes.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.RiCmbJobTypes.Name = "RiCmbJobTypes"; + // // panel3 // this.panel3.Controls.Add(this.OpsGroup); @@ -5334,9 +5336,9 @@ ((System.ComponentModel.ISupportInitialize)(this.RiCmbSex)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbMarriage)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbExamType)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobTypes)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobStatus)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RiCmbHazardFactors)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.RiCmbJobTypes)).EndInit(); this.panel3.ResumeLayout(false); this.TpGroupFeeItem.ResumeLayout(false); this.panel5.ResumeLayout(false); diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index 63e338f..4b208f9 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -188,6 +188,8 @@ namespace PEIS.View.Enrollment PFastChangeCost.Click += PFastChangeCost_Click; PFastRefreshCost.Click += PFastRefreshCost_Click; #endregion + + DgvGroup.CellValueChanged += DgvGroup_CellValueChanged; } /// @@ -209,7 +211,6 @@ namespace PEIS.View.Enrollment { DtpBegDate.Value = DateTime.Now.AddDays(-30); DtpEndDate.Value = DateTime.Now; - RiCmbExamType.Items.AddRange(Global._lstConfig.Where(a => a.Key.Equals("ExamType")).ToList().Select(a => a.Value).ToList()); RiCmbSex.Items.Add("男/女"); RiCmbSex.Items.Add("男"); RiCmbSex.Items.Add("女"); @@ -217,10 +218,12 @@ namespace PEIS.View.Enrollment RiCmbMarriage.Items.Add("已婚"); RiCmbMarriage.Items.Add("未婚"); RiCmbJobStatus.Items.AddRange(Global._lstDictHazardTypes.Where(a => a.ParentID == null).ToList().Select(a => a.Name).ToList()); - RiCmbJobTypes.Items.Add("测试工种1"); - RiCmbJobTypes.Items.Add("测试工种2"); - foreach (var item in Global._lstDictHazardTypes.Where(a => a.ParentID != null).ToList().Select(a => a.Name).ToList()) + var _lst = DAOHelp.GetDataBySQL($@"SELECT Name FROM Dict_HazardType + WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID) + AND ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '岗前' ))"); + + foreach (var item in _lst.Select(s => s.Name).ToList()) { RiCmbHazardFactors.Items.Add(item); } @@ -297,6 +300,16 @@ namespace PEIS.View.Enrollment { if (!DgvGroup.GetSelectedRows().Any()) return; + var status = DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "JobStatus")?.ToString(); + var _lst = DAOHelp.GetDataBySQL($@"SELECT Name FROM Dict_HazardType + WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID) + AND ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status ?? "岗前"}'))"); + + foreach (var item in _lst.Select(s => s.Name).ToList()) + { + RiCmbHazardFactors.Items.Add(item); + } + if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) return; RbAll_Click(sender, e); @@ -314,8 +327,9 @@ namespace PEIS.View.Enrollment AgeMin = 0, AgeMax = 999, Marriage = "所有", - Sex = "男/女" - + Sex = "男/女", + JobStatus = Convert.ToBoolean(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "IsOccupational")) ? "岗前" : null, + Type = Convert.ToBoolean(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "IsOccupational")) ? "职业体检" : "健康体检" }); DgvGroup.RefreshData(); @@ -370,7 +384,7 @@ namespace PEIS.View.Enrollment if (item.CheckTime != null) continue; // 避免重复开设,删除分组原有所有项目 - DAOHelp.ExecuteSql($@"UPDATE Enrollment_OrgFeeItem SET GroupID = -{item?.ID}, CreateTime = GETDATE(), CreatorCode = '{Global.currentUser.Code}', Creator = '{Global.currentUser.Name}' WHERE GroupID = {item?.ID}"); + DAOHelp.ExecuteSql($@" DELETE FROM Enrollment_OrgFeeItem WHERE GroupID = {item?.ID}"); List _feeItemsList = new List(); @@ -904,6 +918,20 @@ namespace PEIS.View.Enrollment { if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return; OnGetRegInfo(_chooseRegItem.ID); + + if (_regInfo.SignTime != null) + { + Global.Msg("info", "当前体检者已发送不可编辑!"); + return; + } + + if (_lstCheckCost.Where(w => w.EID == _regInfo.ID).Count() != 0) + { + Global.Msg("info", "当前体检者下存在订单,请删除后再试!"); + return; + } + + NewEnrollmentPersonForm enrollmentPersonForm = new NewEnrollmentPersonForm(_regInfo, true); enrollmentPersonForm.ShowDialog(); OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString())); @@ -1216,6 +1244,24 @@ namespace PEIS.View.Enrollment OnRecallDept(item.ID); } // 撤回发送 + private void DgvGroup_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) // 在岗情况判断 + { + if (e.Column.FieldName == "JobStatus") + { + // 获取当前行的前一列的值 + var status = DgvGroup.GetRowCellValue(e.RowHandle, e.Column)?.ToString(); + var _lst = DAOHelp.GetDataBySQL($@"SELECT Name FROM Dict_HazardType + WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID) + AND ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status ?? "岗前"}'))"); + + foreach (var item in _lst.Select(s => s.Name).ToList()) + { + RiCmbHazardFactors.Items.Add(item); + } + } + } + + #region 团体订单 private void TFastCancelCharge_Click(object sender, EventArgs e) // 取消记账 diff --git a/PEIS/View/Enrollment/EnrollmentPersonForm.cs b/PEIS/View/Enrollment/EnrollmentPersonForm.cs index 56570db..e448d7e 100644 --- a/PEIS/View/Enrollment/EnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/EnrollmentPersonForm.cs @@ -309,6 +309,19 @@ namespace PEIS.View.Enrollment private void TsmiRegEdit_Click(object sender, EventArgs e) // 编辑登记信息 { if (_lstRegItems == null || _lstRegItems.Count() == 0) return; + + if(_chooseRegItem.SignTime != null) + { + Global.Msg("info", "当前体检者已发送不可编辑!"); + return; + } + + if(_lstCheckCost.Count != 0) + { + Global.Msg("info", "当前体检者下存在订单,请删除后再试!"); + return; + } + NewEnrollmentPersonForm enrollmentPersonForm = new NewEnrollmentPersonForm(_chooseRegItem, true); enrollmentPersonForm.ShowDialog(); OnGetRegItems(0); diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs index c3771fe..57e5786 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs @@ -58,6 +58,8 @@ namespace PEIS.View.Enrollment Tel1.Leave += Tel1_Leave; // 职业病判断 ExamTypeComboBox.SelectedValueChanged += ExamTypeComboBox_SelectedValueChanged; + // 在岗情况判断 + JobStatusComboBox.SelectedIndexChanged += JobStatusComboBox_SelectedIndexChanged; if (editStatus && Global.currentUser.Code == Global._hospital.DoctCode) @@ -70,6 +72,21 @@ namespace PEIS.View.Enrollment } } + private void JobStatusComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + var status = JobStatusComboBox.SelectedValue?.ToString(); + var _lst = DAOHelp.GetDataBySQL($@"SELECT Name FROM Dict_HazardType + WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID) + AND 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"; + } + private void ExamTypeComboBox_SelectedValueChanged(object sender, EventArgs e) { var type = ExamTypeComboBox.SelectedValue?.ToString(); @@ -151,6 +168,7 @@ namespace PEIS.View.Enrollment private void NewEnrollmentPersonForm_Shown(object sender, EventArgs e) { ThreadPool.QueueUserWorkItem(state => GetConfig()); + JobStatusComboBox_SelectedIndexChanged(sender, e); Open_Camera(); } @@ -508,14 +526,6 @@ namespace PEIS.View.Enrollment JobStatusComboBox.DisplayMember = "Name"; JobStatusComboBox.ValueMember = "Name"; - - foreach (var item in Global._lstDictHazardTypes.Where(a => a.ParentID != null).ToList()) - { - HazardFactorsComboBox.Properties.Items.Add(item.Name); - } - HazardFactorsComboBox.Properties.DisplayMember = "Name"; - HazardFactorsComboBox.Properties.ValueMember = "Name"; - SelectPerson(new BasePatient(_regInfo)); })); }