diff --git a/PEIS/App.config b/PEIS/App.config index 27cbe31..7f45f9a 100644 --- a/PEIS/App.config +++ b/PEIS/App.config @@ -7,19 +7,21 @@ - + + + + + + + + - - - - - + @@ -30,8 +32,10 @@ - - + + + + diff --git a/PEIS/Entity/EnrollmentOrg.cs b/PEIS/Entity/EnrollmentOrg.cs index b135759..2bc090c 100644 --- a/PEIS/Entity/EnrollmentOrg.cs +++ b/PEIS/Entity/EnrollmentOrg.cs @@ -31,5 +31,17 @@ namespace PEIS.Entity /// 开票名称 /// public String InvoiceName { get; set; } + /// + /// 团体缴费状态 + /// 0: 团体下所有人的团体订单已缴费(已结账) + /// >0:未结账 + /// + [RefFlag(true)] + public Int32? OrgCostStatus { get; set; } + /// + /// 团体下登记人数 + /// + [RefFlag(true)] + public Int32? OrgPeopleNumber { get; set; } } } \ No newline at end of file diff --git a/PEIS/Entity/EnrollmentPatient.cs b/PEIS/Entity/EnrollmentPatient.cs index 4b71156..5af027f 100644 --- a/PEIS/Entity/EnrollmentPatient.cs +++ b/PEIS/Entity/EnrollmentPatient.cs @@ -117,6 +117,9 @@ namespace PEIS.Entity [RefFlag(true)] public Int64 RowNumber { get; set; } - #endregion Other - } + [RefFlag(true)] + public Decimal Discount { get; set; } + + #endregion Other +} } \ No newline at end of file diff --git a/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs b/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs index 048ed41..7db780a 100644 --- a/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentCheckCostModel.cs @@ -34,8 +34,18 @@ 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 AND CancelTime is null AND EID > 0"); - 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"); + 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 AND EID > 0"); + 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/Model/Enrollment/EnrollmentOrgFeeItemModel.cs b/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs index 57eb465..dcd4a8c 100644 --- a/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs @@ -70,6 +70,23 @@ namespace PEIS.Model.Enrollment DAOHelp.ExecuteSql($"UPDATE dbo.Enrollment_OrgGroup SET Checker = '{Global.currentUser.Name}', CheckerCode = '{Global.currentUser.Code}', CheckTime = GETDATE() WHERE OID = {oeID} AND ID = {groupID}"); } + public void CancelOrgFeeItem(Int64 oeID, Int64 groupID, string oeName) + { + // 个人登记信息 + int delPatient = DAOHelp.ExecuteSql($@"delete from Enrollment_Patient where OEID = {oeID} and GroupId = {groupID}"); + // 个人收费信息 + int delFeeItem = DAOHelp.ExecuteSql($@"delete from Enrollment_FeeItem where OEID = {oeID} and GroupId = {groupID}"); + // 删除应用时间 + DAOHelp.ExecuteSql($@"update Enrollment_OrgGroup set Checker = NULL, CheckerCode = NULL, CheckTime = NULL WHERE OID = {oeID} AND ID = {groupID}"); + // 记录日志 + if (delPatient > 0 && delFeeItem > 0) + { + List orgGroups = DAOHelp.GetDataBySQL($@"select * from Enrollment_OrgGroup where ID = {groupID} and OID = {oeID}"); + EnrollmentOrgGroup group = orgGroups?.Count > 0 ? orgGroups[0] : null; + new Entity.Log($@"撤销团体分组成员的模版应用:团体={oeName},团体号={oeID}, 分组名称={group?.Name},分组ID={groupID}", "3").Save(); + } + } + public void DelItemByPackID(Int64 groupId, Int64 packId) { var sql = $"DELETE FROM Enrollment_OrgFeeItem WHERE GroupID = {groupId} AND PackID = {packId}"; diff --git a/PEIS/Model/Enrollment/EnrollmentOrgModel.cs b/PEIS/Model/Enrollment/EnrollmentOrgModel.cs index 8afb345..8ee8621 100644 --- a/PEIS/Model/Enrollment/EnrollmentOrgModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentOrgModel.cs @@ -36,11 +36,39 @@ namespace PEIS.Model.Enrollment // EnrollmentPatient c = DAOHelp.GetById(new EnrollmentPatient { ID = 12671 }) as EnrollmentPatient; if (String.IsNullOrEmpty(name)) { - return DAOHelp.GetDataBySQL($"Select * from Enrollment_Org Where ExamDate Between '{begTime}' And DateAdd(day, 1,'{endTime}')"); + return DAOHelp.GetDataBySQL($@"Select + c.*, + (select COUNT(ID) from Enrollment_Patient where OEID = c.ID) as OrgPeopleNumber, + (SELECT COUNT(A.ID) + FROM Enrollment_Patient A + WHERE A.OEID = c.ID + and NOT EXISTS ( + SELECT 1 + FROM Enrollment_CheckCost B + WHERE B.EID = A.ID + and b.DeleteTime is null + and b.CostTime is not null + and b.OEID is not null + )) as OrgCostStatus + from Enrollment_Org c Where c.ExamDate Between '{begTime}' And DateAdd(day, 1,'{endTime}')"); } else { - return DAOHelp.GetDataBySQL($"Select * from Enrollment_Org Where Name like '%{name}%' or SpellCode like '%{name}%'"); + return DAOHelp.GetDataBySQL($@"Select + c.*, + (select COUNT(ID) from Enrollment_Patient where OEID = c.ID) as OrgPeopleNumber, + (SELECT COUNT(A.ID) + FROM Enrollment_Patient A + WHERE A.OEID = c.ID + and NOT EXISTS ( + SELECT 1 + FROM Enrollment_CheckCost B + WHERE B.EID = A.ID + and b.DeleteTime is null + and b.CostTime is not null + and b.OEID is not null + )) as OrgCostStatus + from Enrollment_Org c Where c.Name like '%{name}%' or c.SpellCode like '%{name}%'"); } } @@ -54,18 +82,16 @@ namespace PEIS.Model.Enrollment // 插入常规检查男/女 var normal = $@"EXEC sp_InsertNormalFeeItem {eID};"; - // 发送后变更执行科室 //同步分检 + // 发送后变更执行科室 + // 同步分检,生成科室分检信息 var dept = $@"EXEC sp_UpdateSendToDept {eID};"; var cResult = DAOHelp.ExecuteSql(checkCost, false); var eResult = DAOHelp.ExecuteSql(enrollmentPatient, false); var fResult = DAOHelp.ExecuteSql(enrollmentFeeItem, false); var nResult = DAOHelp.ExecuteSql(normal); - - if (Global._hospital.Name == "德宏州中医医院") - { - var dResult = DAOHelp.ExecuteSql(dept); - } + + var dResult = DAOHelp.ExecuteSql(dept); return cResult > 0 && eResult > 0 && fResult > 0; } @@ -118,6 +144,8 @@ namespace PEIS.Model.Enrollment a.Tel1, c.DeptName, a.SignTime, + (SELECT SUM ([sum]) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL AND CancelTime IS NULL ) AS Price, + (SELECT ROUND(CAST((SUM (Fee) / SUM([Sum]) * 10) AS DECIMAL(10,2)), 2) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL AND CancelTime IS NULL ) AS Discount, (SELECT SUM(Fee) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL) AS Fee, a.Description FROM diff --git a/PEIS/Model/Enrollment/EnrollmentPatientModel.cs b/PEIS/Model/Enrollment/EnrollmentPatientModel.cs index 8efb9b9..4df951e 100644 --- a/PEIS/Model/Enrollment/EnrollmentPatientModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentPatientModel.cs @@ -90,10 +90,6 @@ namespace PEIS.Model.Enrollment END AS Signer from Enrollment_Patient a LEFT JOIN Base_Patient b ON a.PID = b.ID LEFT JOIN Base_OrgPatient c ON c.OID = a.OID AND c.PID = b.ID Where a.OEID = {oeID} order by c.DeptName,a.SignTime"); } - - - - // 记 账 public bool ChargeOrder(Int64 Id, String isAlll) @@ -119,21 +115,19 @@ namespace PEIS.Model.Enrollment var enrollmentPatient = $@"UPDATE Enrollment_Patient SET ExamDate = GETDATE(), SignTime = GETDATE(), SignerCode = '{Global.currentUser.Code}', Signer = '{Global.currentUser.Name}' WHERE ID = {EId} AND SignTime is null"; var enrollmentFeeItem = $@"UPDATE a SET a.IsSend = 1 FROM Enrollment_FeeItem a LEFT JOIN Enrollment_CheckCost b ON a.OrderNO = b.ID AND a.EID = b.EID WHERE b.SendTime IS NOT NULL AND a.EID = {EId}; "; - // 插入常规检查男/女 //同步分检 + // 插入常规检查男/女 var normal = $@"EXEC sp_InsertNormalFeeItem {EId};"; - + // 发送后变更执行科室 + // 同步分检,生成科室分检信息 var dept = $@"EXEC sp_UpdateSendToDept {EId};"; var cResult = DAOHelp.ExecuteSql(checkCost, false); var eResult = DAOHelp.ExecuteSql(enrollmentPatient, false); var fResult = DAOHelp.ExecuteSql(enrollmentFeeItem, false); var nResult = DAOHelp.ExecuteSql(normal); - - if (Global._hospital.Name == "德宏州中医医院") - { - var dResult = DAOHelp.ExecuteSql(dept); - } + + var dResult = DAOHelp.ExecuteSql(dept); return cResult > 0 && eResult > 0 && fResult > 0; } diff --git a/PEIS/Model/Exam/PartModel.cs b/PEIS/Model/Exam/PartModel.cs index c3ec68c..bfddbba 100644 --- a/PEIS/Model/Exam/PartModel.cs +++ b/PEIS/Model/Exam/PartModel.cs @@ -233,13 +233,38 @@ namespace PEIS.Model // 检验检查心电科室Code var deptCodeList = Global._lstConfig.Where(p => p.Key == "CheckDeptCode").Select(p => p.Code).ToList(); - //new List() - //{ - // "3101", //病理科 - // "3201", //放射科 - // "3203", //超声科 - //}; - + + #region 各分支科室设置 + // dhzzyy + /* new List() + { + "3101", //病理科 + "3201", //放射科 + "3203", //超声科 + };*/ + // msfy + /*new List() + { + "01064", //心电室 + "3201", //放射科 + "3202", //超声科 + };*/ + // yjfy + /*new List() + { + "3101", //病理科 + "3201", //放射科 + "3202", //超声科 + };*/ + // mzzyy + /*new List() + { + "3101", //病理科 + "3201", //放射科 + "3202", //超声科 + };*/ + #endregion + var index = 1; results.GroupBy(g => g.FeeItemName).ToList().ForEach(items => { @@ -248,7 +273,24 @@ namespace PEIS.Model summary += Environment.NewLine; } summary += $@"{index}.{items.Key}:" + Environment.NewLine; - if (!deptCodeList.Contains(deptCode) && deptCode != "0141") + + if (!deptCodeList.Contains(deptCode)) + { + summary += string.Join(Environment.NewLine, + items.Select(s => $@" {s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag};").ToList()); + } + else + { + summary += string.Join(Environment.NewLine, items.Select(s => $@" {s.TextResult}").ToList()); + var suggestion = items.FirstOrDefault()?.TextResult ?? ""; + if (!string.IsNullOrEmpty(suggestion) && !string.IsNullOrEmpty(items.Key) && part.ID > 0) + { + DAOHelp.ExecuteSql( + $@" INSERT INTO Exam_Conclusion(PID, Conclusion, Suggestion, EID)VALUES({part.ID},'{items.Key}','{suggestion}',{eid})"); + } + } + + /*if (!deptCodeList.Contains(deptCode) && deptCode != "0141") { summary += string.Join(Environment.NewLine, items.Select(s => $@"{s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag};").ToList()); @@ -265,13 +307,15 @@ namespace PEIS.Model if (!string.IsNullOrEmpty(suggestion) && !string.IsNullOrEmpty(items.Key) && part.ID > 0) { DAOHelp.ExecuteSql( - $@" INSERT INTO Exam_Conclusion(PID, Conclusion, Suggestion, EID)VALUES({part.ID},'{items.Key}','{suggestion}',{eid})"); + $@"INSERT INTO Exam_Conclusion(PID, Conclusion, Suggestion, EID)VALUES({part.ID},'{items.Key}','{suggestion}',{eid})"); } - } + }*/ index += 1; }); - if (string.IsNullOrEmpty(summary)) + if (string.IsNullOrEmpty(summary)) + { summary = "未见明显异常"; + } DAOHelp.ExecuteSql($@"UPDATE Exam_Part SET Summary='{summary}' Where EID={eid} AND DeptCode='{deptCode}'"); var exits = DAOHelp.ExecuteSql($@" @@ -480,11 +524,10 @@ namespace PEIS.Model B.Positive, B.InTime, B.SpcimenName - FROM Enrollment_FeeItem A - LEFT JOIN Report B ON A.EID = B.EID AND A.ID= B.ReportNo -LEFT JOIN Dict_FeeItem FeeItem ON A.FID= FeeItem.ID + LEFT JOIN Report B ON A.EID = B.EID AND A.ID = B.ReportNo + LEFT JOIN Dict_FeeItem FeeItem ON A.FID= FeeItem.ID WHERE A.ItemClass = '检查' AND FeeItem.IsHide=0 AND A.eid = {eid}").ToList(); return reportList; @@ -545,14 +588,13 @@ LEFT JOIN Dict_FeeItem FeeItem ON A.FID= FeeItem.ID var general = GeneralExamResult(eid, deptCode); var lis = deptCode== "3001" ? LisExamResult(eid, deptCode) : new List(); var jyLis = GetJyLisResult(eid, deptCode); - var pacs = PacsExamResult(eid, deptCode) ; + var pacs = PacsExamResult(eid, deptCode); var data = giveUp.Union(general).ToList() .Union(lis).ToList() - //.Union(jyLis).ToList() + .Union(jyLis).ToList() .Union(pacs).ToList() .Distinct().ToList(); - // data.RemoveAll(p => p.FID == null); return data.Distinct().OrderBy(o => o.FID).ThenBy(t => t.RID).ToList(); } diff --git a/PEIS/Model/Exam/TotalModel.cs b/PEIS/Model/Exam/TotalModel.cs index 17b8761..4d30cb6 100644 --- a/PEIS/Model/Exam/TotalModel.cs +++ b/PEIS/Model/Exam/TotalModel.cs @@ -159,7 +159,7 @@ namespace PEIS.Model } else { - return DAOHelp.GetDataBySQL($@" SELECT * FROM Exam_Part WHERE EID= {eid} ORDER BY DeptCode") + return DAOHelp.GetDataBySQL($@"SELECT * FROM Exam_Part WHERE EID= {eid} ORDER BY DeptCode") .ToList(); } } diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj index 537931d..500f9e3 100644 --- a/PEIS/PEIS.csproj +++ b/PEIS/PEIS.csproj @@ -786,13 +786,13 @@ Always - + Always - + Always - + Always diff --git a/PEIS/Presenter/EnrollmentOrgPresenter.cs b/PEIS/Presenter/EnrollmentOrgPresenter.cs index 5f2c84c..ddbd03b 100644 --- a/PEIS/Presenter/EnrollmentOrgPresenter.cs +++ b/PEIS/Presenter/EnrollmentOrgPresenter.cs @@ -73,6 +73,11 @@ namespace PEIS.Presenter new EnrollmentOrgFeeItemModel().ApplyOrgFeeItem(args.EnrollmentOID, args.GroupID); View.ShowEnrollmentOrgGroup(new EnrollentOrgGroupModel().GetByoID(args.EnrollmentOID)); }; + View.CancelGroupFeeItem += (send, args) => + { + new EnrollmentOrgFeeItemModel().CancelOrgFeeItem(args.EnrollmentOID, args.GroupID, args.Name); + View.ShowEnrollmentOrgGroup(new EnrollentOrgGroupModel().GetByoID(args.EnrollmentOID)); + }; View.GetEnrollmentPatient += (send, args) => { View.ShowEnrollmentPatient(new EnrollmentPatientModel().GetEnrollmentPatientByEnrollmentOrg(args.EnrollmentOID)); diff --git a/PEIS/Program.cs b/PEIS/Program.cs index 1cebfac..051288b 100644 --- a/PEIS/Program.cs +++ b/PEIS/Program.cs @@ -2,12 +2,8 @@ using PEIS.Utils; using PEIS.View; using System; -using System.Diagnostics; using System.Threading; using System.Windows.Forms; -using DevExpress.XtraEditors.NavigatorButtons; -using PEIS.View.Exam; -using PEIS.View.Setting; namespace PEIS { @@ -34,6 +30,10 @@ namespace PEIS //var s = MySecurity.SEncryptString("Data Source=192.168.12.112;Initial Catalog=peisdb;User ID=XBDLISUser;Password=BlueFlag.Lis!@#"); + //var s = MySecurity.SEncryptString("Data Source=192.168.12.112;Initial Catalog=peisdb;User ID=sa;Password=xbdLis!@#77911"); + + + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/PEIS/ReportFiles/体检基本信息登记表.xls b/PEIS/ReportFiles/BasicInformationRegistration.xls similarity index 100% rename from PEIS/ReportFiles/体检基本信息登记表.xls rename to PEIS/ReportFiles/BasicInformationRegistration.xls diff --git a/PEIS/ReportFiles/医院体检人员信息收集样表.xlsx b/PEIS/ReportFiles/HospitalBasicInformationRegistration.xlsx similarity index 100% rename from PEIS/ReportFiles/医院体检人员信息收集样表.xlsx rename to PEIS/ReportFiles/HospitalBasicInformationRegistration.xlsx diff --git a/PEIS/ReportFiles/Msfy/PReport.frx b/PEIS/ReportFiles/Msfy/PReport.frx index 3e50847..9f86336 100644 --- a/PEIS/ReportFiles/Msfy/PReport.frx +++ b/PEIS/ReportFiles/Msfy/PReport.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -168,10 +168,12 @@ namespace FastReport } private void Text12_AfterData(object sender, EventArgs e) - { - if(Report.GetParameterValue("TeamName").ToString().Equals(Report.GetParameterValue("Company").ToString())) + { + string teamName = (string)Report.GetParameterValue("TeamName") ?? ""; + string company = (string)Report.GetParameterValue("Company") ?? ""; + if (teamName.ToString().Equals(company.ToString())) { - Text12.Text = Report.GetParameterValue("TeamName").ToString(); + Text12.Text = teamName.ToString(); } } } @@ -220,14 +222,14 @@ namespace FastReport - + - + - + @@ -249,7 +251,7 @@ namespace FastReport - + @@ -265,12 +267,106 @@ namespace FastReport - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -279,7 +375,7 @@ namespace FastReport - + @@ -288,8 +384,8 @@ namespace FastReport - - + + @@ -303,80 +399,8 @@ namespace FastReport - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -385,7 +409,7 @@ namespace FastReport - + @@ -401,7 +425,7 @@ namespace FastReport - + @@ -420,9 +444,9 @@ namespace FastReport - + - + @@ -443,7 +467,7 @@ namespace FastReport - + @@ -453,7 +477,7 @@ namespace FastReport - + @@ -462,7 +486,7 @@ namespace FastReport - + @@ -478,9 +502,9 @@ namespace FastReport - + - + @@ -489,7 +513,7 @@ namespace FastReport - + @@ -512,7 +536,7 @@ namespace FastReport - + @@ -527,7 +551,7 @@ namespace FastReport - + @@ -552,7 +576,7 @@ namespace FastReport - + @@ -564,7 +588,7 @@ namespace FastReport - + @@ -573,16 +597,16 @@ namespace FastReport - + - - - + + + - + @@ -600,7 +624,7 @@ namespace FastReport - + @@ -617,7 +641,7 @@ namespace FastReport - + diff --git a/PEIS/ReportFiles/OrderCount.frx b/PEIS/ReportFiles/OrderCount.frx index c7801c8..cb7ec1b 100644 --- a/PEIS/ReportFiles/OrderCount.frx +++ b/PEIS/ReportFiles/OrderCount.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -31,8 +31,8 @@ namespace FastReport totalSum += Convert.ToDouble(rowData["Sum"].ToString()); totalHisSum += Convert.ToDouble(rowData["Fee"].ToString()); - Cell50.Text = totalSum.ToString(); - Cell51.Text = totalHisSum.ToString(); + Cell50.Text = totalSum.ToString("0.000"); + Cell51.Text = totalHisSum.ToString("0.000"); int total = rowData.CurrentRowNo + 1; Cell49.Text = "-总计- " + total.ToString() +"笔订单"; @@ -55,7 +55,7 @@ namespace FastReport - + @@ -88,7 +88,7 @@ namespace FastReport - + @@ -122,7 +122,7 @@ namespace FastReport - + @@ -135,7 +135,7 @@ namespace FastReport - + diff --git a/PEIS/ReportFiles/OrgExcel.frx b/PEIS/ReportFiles/OrgExcel.frx index be9127e..cdcf079 100644 --- a/PEIS/ReportFiles/OrgExcel.frx +++ b/PEIS/ReportFiles/OrgExcel.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -18,11 +18,17 @@ namespace FastReport { public class ReportScript { + private void Cell96_AfterData(object sender, EventArgs e) + { + if(Cell96.Text.Contains("合计")){ + Cell96.Font = new Font("微软雅黑", (float)10, FontStyle.Bold); + } + } - private void PeopleCount_AfterData(object sender, EventArgs e) + private void Cell83_AfterData(object sender, EventArgs e) { DataSourceBase rowData = Report.GetDataSource("O"); - Cell87.Text = rowData["SignTime"] == null ? "" : Convert.ToDateTime(rowData["SignTime"]).ToString("yyyy-MM-dd"); + Cell83.Text = rowData["SignTime"] == null ? "" : Convert.ToDateTime(rowData["SignTime"]).ToString("yyyy-MM-dd"); } } } @@ -33,77 +39,99 @@ namespace FastReport + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - + + - - - - - - - - + + + + + + - + - - - + + + - - - - + + - - - - - - - - + + + + + + - + - - + + + - + + diff --git a/PEIS/ReportFiles/OrgExcel1.frx b/PEIS/ReportFiles/OrgExcel1.frx new file mode 100644 index 0000000..be9127e --- /dev/null +++ b/PEIS/ReportFiles/OrgExcel1.frx @@ -0,0 +1,112 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void PeopleCount_AfterData(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("O"); + Cell87.Text = rowData["SignTime"] == null ? "" : Convert.ToDateTime(rowData["SignTime"]).ToString("yyyy-MM-dd"); + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PEIS/ReportFiles/PReport.frx b/PEIS/ReportFiles/PReport.frx index e4d42e5..1fc24d7 100644 --- a/PEIS/ReportFiles/PReport.frx +++ b/PEIS/ReportFiles/PReport.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -29,9 +29,9 @@ namespace FastReport private void General_AfterData(object sender, EventArgs e) { DataSourceBase rowData = Report.GetDataSource("G"); - Text95.Text = rowData["Summary"].ToString(); - Text97.Text = rowData["Checker"].ToString(); - Text99.Text = rowData["CheckTime"].ToString(); + Text95.Text = (rowData["Summary"] ?? "").ToString(); + Text97.Text = (rowData["Checker"] ?? "").ToString(); + Text99.Text = (rowData["CheckTime"] ?? "").ToString(); } private void FeeItems_AfterData(object sender, EventArgs e) @@ -168,12 +168,14 @@ namespace FastReport } private void Text12_AfterData(object sender, EventArgs e) - { - if(Report.GetParameterValue("TeamName").ToString().Equals(Report.GetParameterValue("Company").ToString())) + { + string teamName = (string)Report.GetParameterValue("TeamName") ?? ""; + string company = (string)Report.GetParameterValue("Company") ?? ""; + if (teamName.ToString().Equals(company.ToString())) { - Text12.Text = Report.GetParameterValue("TeamName").ToString(); + Text12.Text = teamName.ToString(); } - } + } } } @@ -343,13 +345,13 @@ namespace FastReport - + - + - - + + diff --git a/PEIS/ReportFiles/体检套餐导出模版.xlsx b/PEIS/ReportFiles/PackExportTemplate.xlsx similarity index 100% rename from PEIS/ReportFiles/体检套餐导出模版.xlsx rename to PEIS/ReportFiles/PackExportTemplate.xlsx diff --git a/PEIS/Utils/DAOHelp.cs b/PEIS/Utils/DAOHelp.cs index 0198e0e..6c986cf 100644 --- a/PEIS/Utils/DAOHelp.cs +++ b/PEIS/Utils/DAOHelp.cs @@ -352,8 +352,9 @@ namespace PEIS.Utils } else { - // item.IsDefined(typeof(RefFlagAttribute), false) - if (string.IsNullOrEmpty(dr[item.Name]?.ToString())) + // Attribute.IsDefined(item, typeof(RefFlagAttribute)) + // FixFlagAttribute + if (Attribute.IsDefined(item, typeof(RefFlagAttribute)) || Attribute.IsDefined(item, typeof(FixFlagAttribute)) || string.IsNullOrEmpty(dr[item.Name]?.ToString())) { continue; } diff --git a/PEIS/Utils/ExcelHelper.cs b/PEIS/Utils/ExcelHelper.cs index fadae2f..ac22648 100644 --- a/PEIS/Utils/ExcelHelper.cs +++ b/PEIS/Utils/ExcelHelper.cs @@ -107,6 +107,7 @@ namespace PEIS.Utils private static BasePatient ReadRowToBasePatient(IRow dataRow) { var sex = dataRow.GetCell(2)?.ToString()??""; + var s = dataRow.GetCell(1); return new BasePatient() { // A-0-序号,B-1-姓名,C-2-性别,D-3-民族,E-4-婚姻,F-5-身份证号,G-6-住址,H-7-电话,I-8-部门,J-9备注 @@ -189,7 +190,7 @@ namespace PEIS.Utils /// private IWorkbook GetPackExcelModelFile() { - string filePath = AppDomain.CurrentDomain.BaseDirectory + "\\ReportFiles\\体检套餐导出模版.xlsx"; + string filePath = AppDomain.CurrentDomain.BaseDirectory + "\\ReportFiles\\PackExportTemplate.xlsx"; using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { return new XSSFWorkbook(stream); diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs index 7d6535c..ddb0322 100644 --- a/PEIS/Utils/ReportHelper.cs +++ b/PEIS/Utils/ReportHelper.cs @@ -25,7 +25,6 @@ using PEIS.Entity; using PEIS.Model; using PEIS.Model.Enrollment; using System.Drawing; -using System.Drawing.Drawing2D; using System.Drawing.Imaging; using FastReport.Export.Pdf; using PEIS.Model.Exam; @@ -444,6 +443,15 @@ namespace PEIS.Utils var lstPacsPhotos = new ReportModel().GetPacsPhoto(eid); // 科室小结 var lstExamParts = new ReportModel().GetDeptSummary(eid).Where(p => !string.IsNullOrEmpty(p.Summary)).ToList(); + if (lstExamParts.Count == 0) + { + lstExamParts.Add(new ExamPart + { + DeptCode = "-9999", + DeptName = "", + Summary = "暂无科室小结" + }); + } // 第三方报告 var lstExts = new ReportModel().GetReportExt(eid); @@ -728,6 +736,9 @@ namespace PEIS.Utils rpt.SetParameterValue("CardNo", regInfo.CardNo); rpt.SetParameterValue("HospitalName", Global._hospital?.Name); rpt.SetParameterValue("Remark", regInfo.Description); + rpt.SetParameterValue("Url", + Global.GetWeChatPayUrl() + + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(regInfo.CardNo))); if (string.IsNullOrEmpty(regInfo.Photo)) { diff --git a/PEIS/View/Base/NewPersonForm.cs b/PEIS/View/Base/NewPersonForm.cs index 9f66f2a..8aa9a83 100644 --- a/PEIS/View/Base/NewPersonForm.cs +++ b/PEIS/View/Base/NewPersonForm.cs @@ -41,6 +41,7 @@ namespace PEIS.View.Base // 单位 CompanyTxtBox.TextUpdate += CompanyTxtBox_TextUpdate; + CompanyTxtBox.Enter += CompanyTxtBox_Enter; // 民族 NationBoxTxt.TextUpdate += NationBoxTxt_TextUpdate; @@ -337,7 +338,11 @@ namespace PEIS.View.Base OnGetCompanyData(); } - + private void CompanyTxtBox_Enter(object sender, EventArgs e) + { + CompanyTxtBox.DroppedDown = true; + } + private void NationBoxTxt_TextUpdate(object sender, EventArgs e) { OnGetNationData(); diff --git a/PEIS/View/Base/OrgForm.cs b/PEIS/View/Base/OrgForm.cs index 4d7494d..012e2af 100644 --- a/PEIS/View/Base/OrgForm.cs +++ b/PEIS/View/Base/OrgForm.cs @@ -47,7 +47,6 @@ namespace PEIS.View.Base TxtSearchPerson.Enter += TxtSearchPerson_Enter; TxtSearchPerson.Leave += TxtSearchPerson_Leave; - // DgvPatient.Initialize(); DgvOrg.Initialize(); @@ -119,6 +118,7 @@ namespace PEIS.View.Base } item.SaveOrUpdate(); } + Global.Msg("info", "团体信息保存成功!"); } /// diff --git a/PEIS/View/Base/PatientImportForm.cs b/PEIS/View/Base/PatientImportForm.cs index fbb6725..cd2b788 100644 --- a/PEIS/View/Base/PatientImportForm.cs +++ b/PEIS/View/Base/PatientImportForm.cs @@ -1,13 +1,10 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Windows.Forms; using PEIS.Base; using PEIS.Entity; -using PEIS.Event; -using PEIS.Presenter; using PEIS.Utils; namespace PEIS.View.Base @@ -44,8 +41,8 @@ namespace PEIS.View.Base private void TsmiDown_Click(object sender, EventArgs e) { - // var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "体检基本信息登记表.xls"); - var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "医院体检人员信息收集样表.xlsx"); + // var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "BasicInformationRegistration.xls"); + var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "HospitalBasicInformationRegistration.xlsx"); if (!File.Exists(file)) { Global.MsgErr(@"未找到模板文件!"); @@ -57,8 +54,8 @@ namespace PEIS.View.Base { if (folderDialog.ShowDialog() != DialogResult.OK) return; var targetFolderPath = folderDialog.SelectedPath; - // var targetFilePath = Path.Combine(targetFolderPath, "体检基本信息登记表.xls"); - var targetFilePath = Path.Combine(targetFolderPath, "医院体检人员信息收集样表.xlsx"); + // var targetFilePath = Path.Combine(targetFolderPath, "BasicInformationRegistration.xls"); + var targetFilePath = Path.Combine(targetFolderPath, "HospitalBasicInformationRegistration.xlsx"); try { // 复制文件 diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs index 734583f..d7a95b0 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.Designer.cs @@ -29,11 +29,11 @@ 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(); DevExpress.XtraGrid.GridFormatRule gridFormatRule2 = new DevExpress.XtraGrid.GridFormatRule(); DevExpress.XtraEditors.FormatConditionRuleExpression formatConditionRuleExpression2 = new DevExpress.XtraEditors.FormatConditionRuleExpression(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EnrollmentOrgForm)); this.gridColumn99 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn102 = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemMemoEdit21 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit(); @@ -58,6 +58,7 @@ this.menuStrip2 = new System.Windows.Forms.MenuStrip(); this.TsmiOrgRefresh = new System.Windows.Forms.ToolStripMenuItem(); this.TsmiOrgAdd = new System.Windows.Forms.ToolStripMenuItem(); + this.TsmiOrgUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.label19 = new System.Windows.Forms.Label(); this.DtpEndDate = new System.Windows.Forms.DateTimePicker(); this.DtpBegDate = new System.Windows.Forms.DateTimePicker(); @@ -199,6 +200,7 @@ this.gridColumn65 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn66 = new DevExpress.XtraGrid.Columns.GridColumn(); this.panel4 = new System.Windows.Forms.Panel(); + this.BtnCancelGroupFeeItem = new System.Windows.Forms.Button(); this.BtnApplyGroupFeeItem = new System.Windows.Forms.Button(); this.TpPerson = new DevExpress.XtraTab.XtraTabPage(); this.panel6 = new System.Windows.Forms.Panel(); @@ -383,7 +385,6 @@ this.gridView5 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridView7 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridView8 = new DevExpress.XtraGrid.Views.Grid.GridView(); - this.TsmiOrgUpdate = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemMemoEdit21)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.DgcOrg)).BeginInit(); @@ -830,6 +831,13 @@ this.TsmiOrgAdd.Size = new System.Drawing.Size(70, 30); this.TsmiOrgAdd.Text = "登记"; // + // TsmiOrgUpdate + // + this.TsmiOrgUpdate.Image = ((System.Drawing.Image)(resources.GetObject("TsmiOrgUpdate.Image"))); + this.TsmiOrgUpdate.Name = "TsmiOrgUpdate"; + this.TsmiOrgUpdate.Size = new System.Drawing.Size(64, 30); + this.TsmiOrgUpdate.Text = "编辑"; + // // label19 // this.label19.AutoSize = true; @@ -2858,6 +2866,7 @@ // // panel4 // + this.panel4.Controls.Add(this.BtnCancelGroupFeeItem); this.panel4.Controls.Add(this.BtnApplyGroupFeeItem); this.panel4.Dock = System.Windows.Forms.DockStyle.Top; this.panel4.Location = new System.Drawing.Point(0, 0); @@ -2866,6 +2875,23 @@ this.panel4.Size = new System.Drawing.Size(1196, 44); this.panel4.TabIndex = 141; // + // BtnCancelGroupFeeItem + // + this.BtnCancelGroupFeeItem.BackColor = System.Drawing.Color.White; + this.BtnCancelGroupFeeItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.BtnCancelGroupFeeItem.Dock = System.Windows.Forms.DockStyle.Right; + this.BtnCancelGroupFeeItem.FlatAppearance.BorderSize = 0; + this.BtnCancelGroupFeeItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.BtnCancelGroupFeeItem.Image = global::PEIS.Properties.Resources.取消2; + this.BtnCancelGroupFeeItem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.BtnCancelGroupFeeItem.Location = new System.Drawing.Point(846, 0); + this.BtnCancelGroupFeeItem.Name = "BtnCancelGroupFeeItem"; + this.BtnCancelGroupFeeItem.Size = new System.Drawing.Size(167, 44); + this.BtnCancelGroupFeeItem.TabIndex = 35; + this.BtnCancelGroupFeeItem.Text = "取消分组成员模版应用"; + this.BtnCancelGroupFeeItem.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.BtnCancelGroupFeeItem.UseVisualStyleBackColor = true; + // // BtnApplyGroupFeeItem // this.BtnApplyGroupFeeItem.BackColor = System.Drawing.Color.White; @@ -5279,13 +5305,6 @@ // this.gridView8.Name = "gridView8"; // - // TsmiOrgUpdate - // - this.TsmiOrgUpdate.Image = ((System.Drawing.Image)(resources.GetObject("TsmiOrgUpdate.Image"))); - this.TsmiOrgUpdate.Name = "TsmiOrgUpdate"; - this.TsmiOrgUpdate.Size = new System.Drawing.Size(64, 30); - this.TsmiOrgUpdate.Text = "编辑"; - // // EnrollmentOrgForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); @@ -5760,5 +5779,6 @@ private System.Windows.Forms.Button DelPatientBtn; private DevExpress.XtraGrid.Columns.GridColumn gridColumn38; private System.Windows.Forms.ToolStripMenuItem TsmiOrgUpdate; + private System.Windows.Forms.Button BtnCancelGroupFeeItem; } } \ No newline at end of file diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index 35141b0..4ef78de 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -87,6 +87,7 @@ namespace PEIS.View.Enrollment DgvOrg.SelectionChanged += DgvOrg_SelectionChanged; DgvOrg.CustomDrawRowIndicator += DgvOrg_CustomDrawRowIndicator; + DgvOrg.RowStyle += DgvOrg_RowStyle; DgvGroup.SelectionChanged += DgvGroup_SelectionChanged; DgvGroup2.SelectionChanged += DgvGroup2_SelectionChanged; @@ -99,7 +100,7 @@ namespace PEIS.View.Enrollment ImportBtn.Click += ImportBtn_Click; DgvGroupPatient.MouseDown += DgvGroupPatient_MouseDown; - DgvGroupPatient.DoubleClick += DgvGroupPatient_DoubleClick; ; + DgvGroupPatient.DoubleClick += DgvGroupPatient_DoubleClick; DgvGroupFeeItem.MouseDown += DgvGroupFeeItem_MouseDown; DgvGroupFeeItem.DoubleClick += DgvGroupFeeItem_DoubleClick; @@ -111,7 +112,10 @@ namespace PEIS.View.Enrollment DgvFeeItem.MouseDown += DgvFeeItem_MouseDown; DgvFeeItem.DoubleClick += DgvFeeItem_DoubleClick; + // 应用模版 BtnApplyGroupFeeItem.Click += BtnApplyGroupFeeItem_Click; + // 取消模版应用 + BtnCancelGroupFeeItem.Click += BtnCancelGroupFeeItem_Click; FastCamera.Click += FastCamera_Click; DgvEnrollment.SelectionChanged += DgvEnrollment_SelectionChanged; @@ -475,7 +479,14 @@ namespace PEIS.View.Enrollment { if (DgvPatient.FocusedRowHandle < 0) return; if (!DgvGroup.GetSelectedRows().Any()) return; - if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) return; + // 团体登记不存在 + if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()) == 0) return; + // 分组不存在或为保存 + if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) + { + Global.Msg("info", "分组不存在或者分组未保存,请检查分组设置!"); + return; + } if (!_hInfo.InRowCell) return; var item = _lstPatient[_lstPatient.IndexOf(_lstPatient.Where(a => a.ID == Convert.ToInt64(DgvPatient.GetRowCellValue(DgvPatient.GetSelectedRows()[0], "ID").ToString())).ToList()[0])]; @@ -558,8 +569,22 @@ namespace PEIS.View.Enrollment if (Global.Msg("warn", "是否将收费模板应用到当前分组成员?") == System.Windows.Forms.DialogResult.No) return; OnApplyGroupFeeItem(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString())); + } + private void BtnCancelGroupFeeItem_Click(object sender, EventArgs e) + { + Int64 _oeid = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()); + Int64 _groupId = Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()); + String _oename = DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString(); + List _checkCost = DAOHelp.GetDataBySQL($@"select a.* from Enrollment_CheckCost a left join Enrollment_Patient b on a.EID = b.ID and a.OEID = b.OEID where b.OEID = {_oeid} and b.GroupId = {_groupId}"); + if (_checkCost.Count > 0) + { + Global.Msg("info", "该团体分组成员已生成订单,无法撤销分组成员的模版应用!"); + return; + } + if (Global.Msg("info", "确定撤销分组成员的模版应用?") == DialogResult.No) return; + OnCancelGroupFeeItem(_oeid, _groupId, _oename); } private void DgvFeeItem_DoubleClick(object sender, EventArgs e) // 双击添加分组项目 @@ -959,7 +984,14 @@ namespace PEIS.View.Enrollment private void ImportBtn_Click(object sender, EventArgs e) // 全部导入 { if (!DgvPatient.GetSelectedRows().Any()) return; + // 团体登记不存在 if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()) == 0) return; + // 分组不存在或为保存 + if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) + { + Global.Msg("info", "分组不存在或者分组未保存,请检查分组设置!"); + return; + } var item = new EnrollmentOrgPatient(); var orgPatients = _lstPatient.Where(a => (DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString() == "所有" ? true : a?.Marriage == DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString()) @@ -1076,11 +1108,13 @@ 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()); rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString()); rpt.SetParameterValue("TotalFee", _lstExcelEPatient.Sum(s => s.Fee)); + rpt.SetParameterValue("TotalPrice", _lstExcelEPatient.Sum(s => s.Price)); // 人员数据 rpt.RegisterData(_lstExcelEPatient, "O"); @@ -1088,6 +1122,31 @@ namespace PEIS.View.Enrollment checkCost.DataSource = rpt.Report.GetDataSource("O"); rpt.GetDataSource("O").Enabled = true; + if (Global._hospital.Name == "芒市妇幼保健院") + { + // 收费项目 + var oeID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()); + var groupFeeItem = DAOHelp.GetDataBySQL($@"SELECT PackName,FeeItemName,Price,GroupID FROM Enrollment_OrgFeeItem WHERE OEID = {oeID} ORDER BY GroupID, DeptName").ToList(); + + var grouped = groupFeeItem.GroupBy(item => item.GroupID) + .Select(grp => new EnrollmentOrgFeeItem + { + GroupID = grp.Key, + Price = grp.Sum(item => item.Price), + PackName = grp.Where(item => item.PackName != null).ToList().Count() == 0 ? "加项" : grp.Where(item => item.PackName != null).ToList()[0].PackName + }); + + foreach (var group in grouped) + { + groupFeeItem.Add(new EnrollmentOrgFeeItem { GroupID = group.GroupID, PackName = group.PackName, FeeItemName = "合计", Price = group.Price }); + } + + rpt.RegisterData(groupFeeItem.OrderBy(o => o.GroupID).ThenBy(t => t.Price).ToList(), "F"); + DataBand feeItem = rpt.Report.FindObject("OrgFeeItem") as DataBand; + feeItem.DataSource = rpt.Report.GetDataSource("F"); + rpt.GetDataSource("F").Enabled = true; + } + rpt.Prepare(); rpt.Show(); } @@ -1137,16 +1196,22 @@ namespace PEIS.View.Enrollment var rpt = new FastReport.Report(); //实例化一个Report报表 try { + var list = _lstExcelEPatient.Where(w => w.SignTime > begTime.Value.Date && w.SignTime < endTime.Value.AddDays(1).Date).ToList(); + if (list.Count == 0) + { + Global.Msg("info", "所选日期范围内没有签到的体检者,请检查日期范围!"); + return; + } + var reportFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "OrgExcel.frx"); rpt.Load(reportFile); - var list = _lstExcelEPatient.Where(w => w.SignTime > begTime.Value.Date && w.SignTime < endTime.Value.AddDays(1).Date); - rpt.SetParameterValue("TotalCount", list.Count()); rpt.SetParameterValue("No", list.Where(w => w.SignTime == null).ToList().Count()); rpt.SetParameterValue("Yes", list.Where(w => w.SignTime != null).ToList().Count()); rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString()); rpt.SetParameterValue("TotalFee", list.Sum(s => s.Fee)); + rpt.SetParameterValue("TotalPrice", _lstExcelEPatient.Sum(s => s.Price)); // 人员数据 rpt.RegisterData(list, "O"); @@ -1154,6 +1219,31 @@ namespace PEIS.View.Enrollment checkCost.DataSource = rpt.Report.GetDataSource("O"); rpt.GetDataSource("O").Enabled = true; + if (Global._hospital.Name == "芒市妇幼保健院") + { + // 收费项目 + var oeID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()); + var groupFeeItem = DAOHelp.GetDataBySQL($@"SELECT PackName,FeeItemName,Price,GroupID FROM Enrollment_OrgFeeItem WHERE OEID = {oeID} ORDER BY GroupID, DeptName").ToList(); + + var grouped = groupFeeItem.GroupBy(item => item.GroupID) + .Select(grp => new EnrollmentOrgFeeItem + { + GroupID = grp.Key, + Price = grp.Sum(item => item.Price), + PackName = grp.Where(item => item.PackName != null).ToList().Count() == 0 ? "加项" : grp.Where(item => item.PackName != null).ToList()[0].PackName + }); + + foreach (var group in grouped) + { + groupFeeItem.Add(new EnrollmentOrgFeeItem { GroupID = group.GroupID, PackName = group.PackName, FeeItemName = "合计", Price = group.Price }); + } + + rpt.RegisterData(groupFeeItem.OrderBy(o => o.GroupID).ThenBy(t => t.Price).ToList(), "F"); + DataBand feeItem = rpt.Report.FindObject("OrgFeeItem") as DataBand; + feeItem.DataSource = rpt.Report.GetDataSource("F"); + rpt.GetDataSource("F").Enabled = true; + } + rpt.Prepare(); rpt.Show(); } @@ -1561,39 +1651,49 @@ namespace PEIS.View.Enrollment private void DgvCheckCost_RowStyle(object sender, RowStyleEventArgs e) { if (DgvCheckCost.RowCount == 0) return; - if (DgvCheckCost.GetRowCellValue(e.RowHandle, "SendTime") != null) + int hand = e.RowHandle; + if (hand < 0) return; + if (!(DgvCheckCost.GetRow(hand) is EnrollmentCheckCost _order)) return; + if (_order.ChargeTime == null && _order.SendTime == null && _order.CostTime == null) { - e.Appearance.ForeColor = Color.FromArgb(103, 194, 58); + e.Appearance.ForeColor = Color.Black; } - else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "ChargeTime") != null) + if (_order.ChargeTime != null) { e.Appearance.ForeColor = Color.DodgerBlue; } - else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "CostTime") != null) + if (_order.SendTime != null) { e.Appearance.ForeColor = Color.FromArgb(234, 149, 24); } - else - e.Appearance.ForeColor = Color.Black; + if (_order.CostTime != null) + { + e.Appearance.ForeColor = Color.ForestGreen; + } } private void DgvCheckCost2_RowStyle(object sender, RowStyleEventArgs e) { if (DgvCheckCost2.RowCount == 0) return; - if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "SendTime") != null) + int hand = e.RowHandle; + if (hand < 0) return; + if (!(DgvCheckCost2.GetRow(hand) is EnrollmentCheckCost _order)) return; + if (_order.ChargeTime == null && _order.SendTime == null && _order.CostTime == null) { - e.Appearance.ForeColor = Color.FromArgb(103, 194, 58); + e.Appearance.ForeColor = Color.Black; } - else if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "ChargeTime") != null) + if (_order.ChargeTime != null) { e.Appearance.ForeColor = Color.DodgerBlue; } - else if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "CostTime") != null) + if (_order.SendTime != null) { e.Appearance.ForeColor = Color.FromArgb(234, 149, 24); } - else - e.Appearance.ForeColor = Color.Black; + if (_order.CostTime != null) + { + e.Appearance.ForeColor = Color.ForestGreen; + } } private void DgvCheckCost_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) @@ -1683,6 +1783,18 @@ namespace PEIS.View.Enrollment e.Info.DisplayText = (e.RowHandle + 1).ToString(); } + private void DgvOrg_RowStyle(object sender, RowStyleEventArgs e) + { + if (DgvOrg.RowCount == 0) return; + int hand = e.RowHandle; + if (hand < 0) return; + if (!(DgvOrg.GetRow(hand) is EnrollmentOrg _org)) return; + if (_org.OrgCostStatus == 0 && _org.OrgPeopleNumber > 0) + { + e.Appearance.ForeColor = Color.ForestGreen; + } + } + private void DgvGroupFeeItem_MouseDown(object sender, MouseEventArgs e) { _hInfo = DgvGroupFeeItem.CalcHitInfo(e.X, e.Y); @@ -1783,6 +1895,8 @@ namespace PEIS.View.Enrollment public event EventHandler> ApplyGroupFeeItem; + public event EventHandler> CancelGroupFeeItem; + public event EventHandler> GetEnrollmentPatient; public event EventHandler> GetEnrollmentFeeItem; @@ -1910,6 +2024,11 @@ namespace PEIS.View.Enrollment ApplyGroupFeeItem?.Invoke(this, new Args { EnrollmentOID = oeID, GroupID = groupID }); } + protected virtual void OnCancelGroupFeeItem(Int64 OEID, Int64 GroupId, String oeName) + { + CancelGroupFeeItem?.Invoke(this, new Args { EnrollmentOID = OEID, GroupID = GroupId, Name = oeName }); + } + protected virtual void OnAddEnrollmentOrgFeeItem(Int64 groupID, Int64 oeID, Int64 packID, Int64 oID, Int64 feeItemID) { AddEnrollmentOrgFeeItem?.Invoke(this, new Args { GroupID = groupID, EnrollmentOID = oeID, PackID = packID, BaseOID = oID, FeeItemID = feeItemID }); diff --git a/PEIS/View/Enrollment/EnrollmentPersonForm.cs b/PEIS/View/Enrollment/EnrollmentPersonForm.cs index 9625980..73b3cc0 100644 --- a/PEIS/View/Enrollment/EnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/EnrollmentPersonForm.cs @@ -171,27 +171,27 @@ namespace PEIS.View.Enrollment private void DgvCheckCost_RowStyle(object sender, RowStyleEventArgs e) { if (DgvCheckCost.RowCount == 0) return; - if (DgvCheckCost.GetRowCellValue(e.RowHandle, "SendTime") != null) + int hand = e.RowHandle; + if (hand < 0) return; + if (!(DgvCheckCost.GetRow(hand) is EnrollmentCheckCost _order)) return; + if (_order.ChargeTime == null && _order.SendTime == null && _order.CostTime == null) { - e.Appearance.ForeColor = Color.FromArgb(103, 194, 58); + e.Appearance.ForeColor = Color.Black; } - else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "ChargeTime") != null) + if (_order.ChargeTime != null) { e.Appearance.ForeColor = Color.DodgerBlue; } - else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "CostTime") != null) + if (_order.SendTime != null) { e.Appearance.ForeColor = Color.FromArgb(234, 149, 24); } - else + if (_order.CostTime != null) { - e.Appearance.ForeColor = Color.Black; - } - + e.Appearance.ForeColor = Color.ForestGreen; + } } - - private void DgvEFeeItem_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { if (e.Column.FieldName == "PackName") // 替换"PackName" diff --git a/PEIS/View/Enrollment/IEnrollmentOrgView.cs b/PEIS/View/Enrollment/IEnrollmentOrgView.cs index 0aca34a..9ff048c 100644 --- a/PEIS/View/Enrollment/IEnrollmentOrgView.cs +++ b/PEIS/View/Enrollment/IEnrollmentOrgView.cs @@ -36,6 +36,7 @@ namespace PEIS.View.Enrollment event EventHandler> AddEnrollmentOrgFeeItem; event EventHandler> ApplyGroupFeeItem; + event EventHandler> CancelGroupFeeItem; event EventHandler> GetEnrollmentPatient; event EventHandler> GetEnrollmentFeeItem; diff --git a/PEIS/View/Enrollment/NewEnrollmentOrgForm.Designer.cs b/PEIS/View/Enrollment/NewEnrollmentOrgForm.Designer.cs index f1183af..4f89eec 100644 --- a/PEIS/View/Enrollment/NewEnrollmentOrgForm.Designer.cs +++ b/PEIS/View/Enrollment/NewEnrollmentOrgForm.Designer.cs @@ -30,6 +30,8 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewEnrollmentOrgForm)); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.TxtInvoiceName = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); this.occupationFalse = new System.Windows.Forms.RadioButton(); this.occupationTrue = new System.Windows.Forms.RadioButton(); this.label9 = new System.Windows.Forms.Label(); @@ -52,8 +54,6 @@ this.label1 = new System.Windows.Forms.Label(); this.BtnCancel = new System.Windows.Forms.Button(); this.BtnOk = new System.Windows.Forms.Button(); - this.label10 = new System.Windows.Forms.Label(); - this.TxtInvoiceName = new System.Windows.Forms.TextBox(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -87,6 +87,22 @@ this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; // + // TxtInvoiceName + // + this.TxtInvoiceName.Location = new System.Drawing.Point(76, 262); + this.TxtInvoiceName.Name = "TxtInvoiceName"; + this.TxtInvoiceName.Size = new System.Drawing.Size(357, 23); + this.TxtInvoiceName.TabIndex = 42; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(12, 264); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(56, 17); + this.label10.TabIndex = 41; + this.label10.Text = "发票名称"; + // // occupationFalse // this.occupationFalse.AutoSize = true; @@ -248,7 +264,6 @@ // // TxtName // - this.TxtName.Enabled = false; this.TxtName.Location = new System.Drawing.Point(76, 22); this.TxtName.Name = "TxtName"; this.TxtName.Size = new System.Drawing.Size(357, 23); @@ -289,22 +304,6 @@ this.BtnOk.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.BtnOk.UseVisualStyleBackColor = true; // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(12, 264); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(56, 17); - this.label10.TabIndex = 41; - this.label10.Text = "发票名称"; - // - // TxtInvoiceName - // - this.TxtInvoiceName.Location = new System.Drawing.Point(76, 262); - this.TxtInvoiceName.Name = "TxtInvoiceName"; - this.TxtInvoiceName.Size = new System.Drawing.Size(357, 23); - this.TxtInvoiceName.TabIndex = 42; - // // NewEnrollmentOrgForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; diff --git a/PEIS/View/Enrollment/NewEnrollmentOrgForm.cs b/PEIS/View/Enrollment/NewEnrollmentOrgForm.cs index 2f103f5..4f9b64e 100644 --- a/PEIS/View/Enrollment/NewEnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/NewEnrollmentOrgForm.cs @@ -47,6 +47,7 @@ namespace PEIS.View.Enrollment TxtTel1.Text = enrollmentOrg.Tel1; TxtContactor2.Text = enrollmentOrg.Contactor2; TxtTel2.Text = enrollmentOrg.Tel2; + this.Text = "编辑团体登记信息"; } } diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs index a4833c5..1b24145 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.Designer.cs @@ -663,8 +663,6 @@ // // CompanyTxtBox // - this.CompanyTxtBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.CompanyTxtBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; this.CompanyTxtBox.FormattingEnabled = true; this.CompanyTxtBox.Location = new System.Drawing.Point(84, 591); this.CompanyTxtBox.Name = "CompanyTxtBox"; diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs index 7bdd66c..783707b 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs @@ -64,6 +64,7 @@ namespace PEIS.View.Enrollment // 单位 CompanyTxtBox.TextUpdate += CompanyTxtBox_TextUpdate; + CompanyTxtBox.Enter += CompanyTxtBox_Enter; // 民族 NationBoxTxt.TextUpdate += NationBoxTxt_TextUpdate; @@ -522,6 +523,11 @@ namespace PEIS.View.Enrollment OnGetCompanyData(); } + private void CompanyTxtBox_Enter(object sender, EventArgs e) + { + CompanyTxtBox.DroppedDown = true; + } + private void NationBoxTxt_TextUpdate(object sender, EventArgs e) { OnGetNationData(); diff --git a/PEIS/View/Exam/PartForm.Designer.cs b/PEIS/View/Exam/PartForm.Designer.cs index 92c8f90..2423923 100644 --- a/PEIS/View/Exam/PartForm.Designer.cs +++ b/PEIS/View/Exam/PartForm.Designer.cs @@ -879,9 +879,9 @@ // this.panel1.Controls.Add(this.splitContainerExam); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(176, 70); + this.panel1.Location = new System.Drawing.Point(176, 45); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1018, 558); + this.panel1.Size = new System.Drawing.Size(1018, 583); this.panel1.TabIndex = 132; // // splitContainerExam @@ -899,8 +899,8 @@ this.splitContainerExam.Panel1.Text = "Panel1"; this.splitContainerExam.Panel2.Controls.Add(this.splitContainer2); this.splitContainerExam.Panel2.Text = "Panel2"; - this.splitContainerExam.Size = new System.Drawing.Size(1018, 558); - this.splitContainerExam.SplitterPosition = 367; + this.splitContainerExam.Size = new System.Drawing.Size(1018, 583); + this.splitContainerExam.SplitterPosition = 384; this.splitContainerExam.TabIndex = 60; this.splitContainerExam.Text = "splitContainerControl1"; // @@ -961,7 +961,7 @@ this.dgcExamResult.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.SearchLookUpEditSign, this.popupContainerEdit1}); - this.dgcExamResult.Size = new System.Drawing.Size(1018, 367); + this.dgcExamResult.Size = new System.Drawing.Size(1018, 384); this.dgcExamResult.TabIndex = 130; this.dgcExamResult.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvExamResult}); @@ -1200,7 +1200,7 @@ this.splitContainer2.Panel2.BackColor = System.Drawing.Color.White; this.splitContainer2.Panel2.Controls.Add(this.panel5); this.splitContainer2.Panel2.Controls.Add(this.panel6); - this.splitContainer2.Size = new System.Drawing.Size(1018, 186); + this.splitContainer2.Size = new System.Drawing.Size(1018, 194); this.splitContainer2.SplitterDistance = 495; this.splitContainer2.TabIndex = 0; // @@ -1211,7 +1211,7 @@ this.panel17.Dock = System.Windows.Forms.DockStyle.Fill; this.panel17.Location = new System.Drawing.Point(0, 0); this.panel17.Name = "panel17"; - this.panel17.Size = new System.Drawing.Size(495, 186); + this.panel17.Size = new System.Drawing.Size(495, 194); this.panel17.TabIndex = 1; // // txtSummary @@ -1223,7 +1223,7 @@ this.txtSummary.Multiline = true; this.txtSummary.Name = "txtSummary"; this.txtSummary.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtSummary.Size = new System.Drawing.Size(495, 146); + this.txtSummary.Size = new System.Drawing.Size(495, 154); this.txtSummary.TabIndex = 4; // // label17 @@ -1245,7 +1245,7 @@ this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; this.panel5.Location = new System.Drawing.Point(0, 40); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(519, 146); + this.panel5.Size = new System.Drawing.Size(519, 154); this.panel5.TabIndex = 1; // // dgcConclusion @@ -1258,7 +1258,7 @@ this.dgcConclusion.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.CmbSearchConclusion, this.repositoryItemMemoEdit1}); - this.dgcConclusion.Size = new System.Drawing.Size(519, 146); + this.dgcConclusion.Size = new System.Drawing.Size(519, 154); this.dgcConclusion.TabIndex = 124; this.dgcConclusion.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvConclusion, @@ -1466,7 +1466,7 @@ this.panelExamBtn.Dock = System.Windows.Forms.DockStyle.Top; this.panelExamBtn.Location = new System.Drawing.Point(176, 0); this.panelExamBtn.Name = "panelExamBtn"; - this.panelExamBtn.Size = new System.Drawing.Size(1018, 70); + this.panelExamBtn.Size = new System.Drawing.Size(1018, 45); this.panelExamBtn.TabIndex = 60; // // panelDoctor @@ -1481,7 +1481,7 @@ this.panelDoctor.Location = new System.Drawing.Point(0, 0); this.panelDoctor.Margin = new System.Windows.Forms.Padding(0); this.panelDoctor.Name = "panelDoctor"; - this.panelDoctor.Size = new System.Drawing.Size(1018, 70); + this.panelDoctor.Size = new System.Drawing.Size(1018, 45); this.panelDoctor.TabIndex = 132; // // cmbVerifier diff --git a/PEIS/View/Exam/PartForm.cs b/PEIS/View/Exam/PartForm.cs index 2ad2ab8..45087fc 100644 --- a/PEIS/View/Exam/PartForm.cs +++ b/PEIS/View/Exam/PartForm.cs @@ -332,10 +332,6 @@ namespace PEIS.View.Exam /// public void ShowDeptList(List items) { - // items.ForEach(i => - // { - // i.IsSelected=false; - // }); var index = dgvDept.GetFocusedDataSourceRowIndex(); if (index < 0 || index >= items.Count) { @@ -410,7 +406,7 @@ namespace PEIS.View.Exam private void DgvDept_RowCellClick(object sender, RowCellClickEventArgs e) { var rowHandle = e.RowHandle; - if (_lstAllDept[rowHandle] is User dept1 && dept1.Status != "科室分检") return; + // if (_lstAllDept[rowHandle] is User dept1 && dept1.Status != "科室分检") return; dgvDept.SetRowCellValue(rowHandle, colDeptSelected, true); //ResetView(); // 取消其他行的选中状态 @@ -444,7 +440,7 @@ namespace PEIS.View.Exam //OnGetPatients(); // 选中检查科室提取结果按钮显示 - // _currentDept.DeptCode == "3201" || _currentDept.DeptCode == "3203" || _currentDept.DeptCode == "3204" || _currentDept.DeptCode == "3101" + // dhzzyy: _currentDept.DeptCode == "3201" || _currentDept.DeptCode == "3203" || _currentDept.DeptCode == "3204" || _currentDept.DeptCode == "3101" if (Global._lstConfig.Where(p => p.Key == "CheckDeptCode").Select(p => p.Code).ToList().Contains(_currentDept.DeptCode)) { tsmiPick.Visible = true; @@ -861,13 +857,43 @@ namespace PEIS.View.Exam // 检验检查心电科室Code var deptCodeList = Global._lstConfig.Where(p => p.Key == "PartFormDept").Select(p => p.Code).ToList(); - //var deptCodeList = new List() - //{ - // "3001", //检验科 - // "01416", //迪安检验 - // "3201", //放射科 - // "3203", //超声科 - //}; + #region 各分支科室设置 + // dhzzyy + /* var deptCodeList = new List() + { + "3001", //检验科 + "01416", //迪安检验 + "3201", //放射科 + "3203", //超声科 + };*/ + // msfy + /*var deptCodeList = new List() + { + "3001", //检验科 + "3002", //金域检验 + "3201", //放射科 + "3202", //超声科 + "01064", //心电科 + };*/ + // yjfy + /*var deptCodeList = new List() + { + "3001", //检验科 + "3002", //金域检验 + "3201", //放射科 + "3202", //超声科 + "3203", //心电科 + };*/ + // mzzyy + /*var deptCodeList = new List() + { + "3001", //检验科 + "3002", //金域检验 + "3201", //放射科 + "3202", //超声科 + };*/ + #endregion + if (deptCodeList.Contains(_currentDept.DeptCode) && _examPart.VerifyTime == null && _examPart.GiveUpTime == null && _examPart.ID == 0) { @@ -1203,6 +1229,11 @@ namespace PEIS.View.Exam if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime != null || _examPart.GiveUpTime != null || _examPart.ID <= 0) return; + if (_examPart.CheckTime == null) { + MessageBox.Show(@"请先保存科室分检的检查结果!", @"审核失败"); + return; + } + var result = MessageBox.Show(@"是否确认审核?", @"审核", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result != DialogResult.Yes) return; @@ -1294,8 +1325,15 @@ namespace PEIS.View.Exam /// private void TsmiReviewCancel_Click(object sender, EventArgs e) { - if (_patient.ID <= 0 || _patient.FinishTime != null || _examPart.VerifyTime == null || + if (_patient.ID <= 0 || _examPart.VerifyTime == null || _examPart.GiveUpTime != null || _examPart.ID <= 0) return; + EnrollmentPatient _p = (EnrollmentPatient)DAOHelp.GetById(new EnrollmentPatient { ID = _patient.ID }); + // 已完结 + if (_p.FinishTime != null) + { + Global.Msg("info", "体检已完结,不允许取消审核!"); + return; + } var result = MessageBox.Show(@"是否取消审核?", @"审核", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result != DialogResult.Yes) return; @@ -1634,7 +1672,7 @@ namespace PEIS.View.Exam /// private void RefreshPatient(EnrollmentPatient item = null) { - Invoke(new Action(() => _patient = item ?? _patient)); + Invoke(new Action(() => _patient = item ?? _patient )); Invoke(new Action(() => stripTxtEid.Text = _patient?.ID.ToString())); // Invoke(new Action(() => patientInfo.Values = item ?? _patient)); SetPatientInfo(item ?? _patient); diff --git a/PEIS/View/Exam/TotalForm.Designer.cs b/PEIS/View/Exam/TotalForm.Designer.cs index 11778d1..fb75f8c 100644 --- a/PEIS/View/Exam/TotalForm.Designer.cs +++ b/PEIS/View/Exam/TotalForm.Designer.cs @@ -178,6 +178,8 @@ this.gridColumn36 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn37 = new DevExpress.XtraGrid.Columns.GridColumn(); this.tabPageHistory = new DevExpress.XtraTab.XtraTabPage(); + this.tabPageResult = new DevExpress.XtraTab.XtraTabPage(); + this.panel6 = new System.Windows.Forms.Panel(); this.panelPatientInfo = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); @@ -315,6 +317,7 @@ ((System.ComponentModel.ISupportInitialize)(this.PictureBoxReportExt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DgcRptExt)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).BeginInit(); + this.tabPageResult.SuspendLayout(); this.panelPatientInfo.SuspendLayout(); this.panel3.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); @@ -860,19 +863,20 @@ // this.splitContainerExamInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(162)))), ((int)(((byte)(202))))); this.splitContainerExamInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainerExamInfo.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainerExamInfo.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainerExamInfo.Location = new System.Drawing.Point(0, 0); this.splitContainerExamInfo.Name = "splitContainerExamInfo"; // // splitContainerExamInfo.Panel1 // this.splitContainerExamInfo.Panel1.Controls.Add(this.panelTxtSummary); + this.splitContainerExamInfo.Panel1MinSize = 500; // // splitContainerExamInfo.Panel2 // this.splitContainerExamInfo.Panel2.Controls.Add(this.panelExamInfoL); this.splitContainerExamInfo.Size = new System.Drawing.Size(860, 506); - this.splitContainerExamInfo.SplitterDistance = 402; + this.splitContainerExamInfo.SplitterDistance = 740; this.splitContainerExamInfo.TabIndex = 0; // // panelTxtSummary @@ -882,7 +886,7 @@ this.panelTxtSummary.Dock = System.Windows.Forms.DockStyle.Fill; this.panelTxtSummary.Location = new System.Drawing.Point(0, 0); this.panelTxtSummary.Name = "panelTxtSummary"; - this.panelTxtSummary.Size = new System.Drawing.Size(402, 506); + this.panelTxtSummary.Size = new System.Drawing.Size(740, 506); this.panelTxtSummary.TabIndex = 2; // // splitExamPart @@ -899,8 +903,8 @@ // splitExamPart.Panel2 // this.splitExamPart.Panel2.Controls.Add(this.txtSummary); - this.splitExamPart.Size = new System.Drawing.Size(402, 506); - this.splitExamPart.SplitterDistance = 186; + this.splitExamPart.Size = new System.Drawing.Size(740, 506); + this.splitExamPart.SplitterDistance = 310; this.splitExamPart.TabIndex = 0; // // panel5 @@ -911,7 +915,7 @@ this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; this.panel5.Location = new System.Drawing.Point(0, 0); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(186, 506); + this.panel5.Size = new System.Drawing.Size(310, 506); this.panel5.TabIndex = 0; // // DgcExamResultData @@ -924,7 +928,7 @@ this.DgcExamResultData.Name = "DgcExamResultData"; this.DgcExamResultData.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemMemoEdit4}); - this.DgcExamResultData.Size = new System.Drawing.Size(600, 489); + this.DgcExamResultData.Size = new System.Drawing.Size(423, 489); this.DgcExamResultData.TabIndex = 0; this.DgcExamResultData.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvExamResultData}); @@ -1086,7 +1090,7 @@ this.txtSummary.Name = "txtSummary"; this.txtSummary.ReadOnly = true; this.txtSummary.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtSummary.Size = new System.Drawing.Size(212, 506); + this.txtSummary.Size = new System.Drawing.Size(426, 506); this.txtSummary.TabIndex = 4; this.txtSummary.Text = "科室小结"; // @@ -1096,7 +1100,7 @@ this.panelExamInfoL.Dock = System.Windows.Forms.DockStyle.Fill; this.panelExamInfoL.Location = new System.Drawing.Point(0, 0); this.panelExamInfoL.Name = "panelExamInfoL"; - this.panelExamInfoL.Size = new System.Drawing.Size(454, 506); + this.panelExamInfoL.Size = new System.Drawing.Size(116, 506); this.panelExamInfoL.TabIndex = 2; // // TabPart @@ -1124,7 +1128,7 @@ this.TabPart.Name = "TabPart"; this.TabPart.SelectedTabPage = this.tabPageConslusion; this.TabPart.ShowTabHeader = DevExpress.Utils.DefaultBoolean.True; - this.TabPart.Size = new System.Drawing.Size(454, 506); + this.TabPart.Size = new System.Drawing.Size(116, 506); this.TabPart.TabIndex = 0; this.TabPart.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabPageConslusion, @@ -1133,7 +1137,8 @@ this.tabPageLis, this.tabPagePacs, this.tabPageReport, - this.tabPageHistory}); + this.tabPageHistory, + this.tabPageResult}); // // tabPageConslusion // @@ -1143,7 +1148,7 @@ this.tabPageConslusion.Image = global::PEIS.Properties.Resources.menu; this.tabPageConslusion.Margin = new System.Windows.Forms.Padding(2); this.tabPageConslusion.Name = "tabPageConslusion"; - this.tabPageConslusion.Size = new System.Drawing.Size(448, 467); + this.tabPageConslusion.Size = new System.Drawing.Size(110, 467); this.tabPageConslusion.Text = "结论词"; // // panelConclussion @@ -1153,7 +1158,7 @@ this.panelConclussion.Dock = System.Windows.Forms.DockStyle.Fill; this.panelConclussion.Location = new System.Drawing.Point(0, 40); this.panelConclussion.Name = "panelConclussion"; - this.panelConclussion.Size = new System.Drawing.Size(107, 427); + this.panelConclussion.Size = new System.Drawing.Size(0, 427); this.panelConclussion.TabIndex = 3; // // DgcExamConclusion @@ -1168,7 +1173,7 @@ this.repositoryItemMemoEdit2, this.CmbSearchConclusion, this.repositoryItemCheckEdit1}); - this.DgcExamConclusion.Size = new System.Drawing.Size(107, 427); + this.DgcExamConclusion.Size = new System.Drawing.Size(0, 427); this.DgcExamConclusion.TabIndex = 5; this.DgcExamConclusion.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvExamConclusion, @@ -1337,7 +1342,7 @@ this.panelAllConclusion.Controls.Add(this.DgcAllConclusion); this.panelAllConclusion.Controls.Add(this.panel2); this.panelAllConclusion.Dock = System.Windows.Forms.DockStyle.Right; - this.panelAllConclusion.Location = new System.Drawing.Point(107, 40); + this.panelAllConclusion.Location = new System.Drawing.Point(-231, 40); this.panelAllConclusion.Name = "panelAllConclusion"; this.panelAllConclusion.Size = new System.Drawing.Size(341, 427); this.panelAllConclusion.TabIndex = 2; @@ -1459,7 +1464,7 @@ this.panelConclussionMenu.Dock = System.Windows.Forms.DockStyle.Top; this.panelConclussionMenu.Location = new System.Drawing.Point(0, 0); this.panelConclussionMenu.Name = "panelConclussionMenu"; - this.panelConclussionMenu.Size = new System.Drawing.Size(448, 40); + this.panelConclussionMenu.Size = new System.Drawing.Size(110, 40); this.panelConclussionMenu.TabIndex = 0; // // OpsConclusion @@ -1468,7 +1473,7 @@ this.OpsConclusion.Location = new System.Drawing.Point(0, 0); this.OpsConclusion.Margin = new System.Windows.Forms.Padding(3, 7, 3, 7); this.OpsConclusion.Name = "OpsConclusion"; - this.OpsConclusion.Size = new System.Drawing.Size(448, 40); + this.OpsConclusion.Size = new System.Drawing.Size(110, 40); this.OpsConclusion.TabIndex = 5; // // tabPageExam @@ -1491,7 +1496,7 @@ this.tabPageExam.Image = global::PEIS.Properties.Resources.menu; this.tabPageExam.Margin = new System.Windows.Forms.Padding(2); this.tabPageExam.Name = "tabPageExam"; - this.tabPageExam.Size = new System.Drawing.Size(448, 467); + this.tabPageExam.Size = new System.Drawing.Size(110, 467); this.tabPageExam.Text = "一般项目"; // // DgcExamResult @@ -1502,7 +1507,7 @@ this.DgcExamResult.Name = "DgcExamResult"; this.DgcExamResult.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemMemoEdit3}); - this.DgcExamResult.Size = new System.Drawing.Size(448, 467); + this.DgcExamResult.Size = new System.Drawing.Size(110, 467); this.DgcExamResult.TabIndex = 140; this.DgcExamResult.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvExamResult}); @@ -1690,7 +1695,7 @@ this.tabPageSummary.Image = global::PEIS.Properties.Resources.menu; this.tabPageSummary.Margin = new System.Windows.Forms.Padding(2); this.tabPageSummary.Name = "tabPageSummary"; - this.tabPageSummary.Size = new System.Drawing.Size(448, 467); + this.tabPageSummary.Size = new System.Drawing.Size(110, 467); this.tabPageSummary.Text = "科室小结"; // // panelDeptSummary @@ -1700,7 +1705,7 @@ this.panelDeptSummary.Dock = System.Windows.Forms.DockStyle.Fill; this.panelDeptSummary.Location = new System.Drawing.Point(0, 0); this.panelDeptSummary.Name = "panelDeptSummary"; - this.panelDeptSummary.Size = new System.Drawing.Size(448, 467); + this.panelDeptSummary.Size = new System.Drawing.Size(110, 467); this.panelDeptSummary.TabIndex = 61; // // DgcSummary @@ -1713,7 +1718,7 @@ this.repositoryItemRichTextEdit1, this.repositoryItemTextEdit1, this.repositoryItemMemoEdit1}); - this.DgcSummary.Size = new System.Drawing.Size(448, 467); + this.DgcSummary.Size = new System.Drawing.Size(110, 467); this.DgcSummary.TabIndex = 0; this.DgcSummary.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvSummary}); @@ -1777,7 +1782,7 @@ this.tabPageLis.Image = global::PEIS.Properties.Resources.menu; this.tabPageLis.Margin = new System.Windows.Forms.Padding(2); this.tabPageLis.Name = "tabPageLis"; - this.tabPageLis.Size = new System.Drawing.Size(448, 467); + this.tabPageLis.Size = new System.Drawing.Size(110, 467); this.tabPageLis.Text = "检验报告"; // // DgcLisReport @@ -1786,7 +1791,7 @@ this.DgcLisReport.Location = new System.Drawing.Point(0, 0); this.DgcLisReport.MainView = this.DgvLisReport; this.DgcLisReport.Name = "DgcLisReport"; - this.DgcLisReport.Size = new System.Drawing.Size(448, 467); + this.DgcLisReport.Size = new System.Drawing.Size(110, 467); this.DgcLisReport.TabIndex = 1; this.DgcLisReport.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.DgvLisReport}); @@ -1897,7 +1902,7 @@ this.tabPagePacs.Image = global::PEIS.Properties.Resources.menu; this.tabPagePacs.Margin = new System.Windows.Forms.Padding(2); this.tabPagePacs.Name = "tabPagePacs"; - this.tabPagePacs.Size = new System.Drawing.Size(448, 467); + this.tabPagePacs.Size = new System.Drawing.Size(110, 467); this.tabPagePacs.Text = "检查报告"; // // panelPacsBase @@ -1907,7 +1912,7 @@ this.panelPacsBase.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPacsBase.Location = new System.Drawing.Point(0, 0); this.panelPacsBase.Name = "panelPacsBase"; - this.panelPacsBase.Size = new System.Drawing.Size(448, 467); + this.panelPacsBase.Size = new System.Drawing.Size(110, 467); this.panelPacsBase.TabIndex = 1; // // xtraTabControl1 @@ -1918,7 +1923,7 @@ this.xtraTabControl1.Location = new System.Drawing.Point(260, 0); this.xtraTabControl1.Name = "xtraTabControl1"; this.xtraTabControl1.SelectedTabPage = this.tabPacsRpt; - this.xtraTabControl1.Size = new System.Drawing.Size(188, 467); + this.xtraTabControl1.Size = new System.Drawing.Size(0, 467); this.xtraTabControl1.TabIndex = 1; this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabPacsRpt, @@ -1928,7 +1933,7 @@ // this.tabPacsRpt.Controls.Add(this.panelPacsRpt); this.tabPacsRpt.Name = "tabPacsRpt"; - this.tabPacsRpt.Size = new System.Drawing.Size(144, 461); + this.tabPacsRpt.Size = new System.Drawing.Size(0, 461); this.tabPacsRpt.Text = "报告"; // // panelPacsRpt @@ -1939,7 +1944,7 @@ this.panelPacsRpt.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPacsRpt.Location = new System.Drawing.Point(0, 0); this.panelPacsRpt.Name = "panelPacsRpt"; - this.panelPacsRpt.Size = new System.Drawing.Size(144, 461); + this.panelPacsRpt.Size = new System.Drawing.Size(0, 461); this.panelPacsRpt.TabIndex = 3; // // pictureBoxPacsRpt @@ -1957,7 +1962,7 @@ // this.tabPacsImg.Controls.Add(this.panel12); this.tabPacsImg.Name = "tabPacsImg"; - this.tabPacsImg.Size = new System.Drawing.Size(144, 461); + this.tabPacsImg.Size = new System.Drawing.Size(0, 461); this.tabPacsImg.Text = "图片"; // // panel12 @@ -1966,7 +1971,7 @@ this.panel12.Dock = System.Windows.Forms.DockStyle.Fill; this.panel12.Location = new System.Drawing.Point(0, 0); this.panel12.Name = "panel12"; - this.panel12.Size = new System.Drawing.Size(144, 461); + this.panel12.Size = new System.Drawing.Size(0, 461); this.panel12.TabIndex = 3; // // panel13 @@ -1976,7 +1981,7 @@ this.panel13.Dock = System.Windows.Forms.DockStyle.Fill; this.panel13.Location = new System.Drawing.Point(0, 0); this.panel13.Name = "panel13"; - this.panel13.Size = new System.Drawing.Size(144, 461); + this.panel13.Size = new System.Drawing.Size(0, 461); this.panel13.TabIndex = 6; // // panel15 @@ -1985,7 +1990,7 @@ this.panel15.Dock = System.Windows.Forms.DockStyle.Fill; this.panel15.Location = new System.Drawing.Point(0, 0); this.panel15.Name = "panel15"; - this.panel15.Size = new System.Drawing.Size(144, 461); + this.panel15.Size = new System.Drawing.Size(0, 461); this.panel15.TabIndex = 4; // // panelPacsImg @@ -1995,7 +2000,7 @@ this.panelPacsImg.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPacsImg.Location = new System.Drawing.Point(0, 0); this.panelPacsImg.Name = "panelPacsImg"; - this.panelPacsImg.Size = new System.Drawing.Size(144, 461); + this.panelPacsImg.Size = new System.Drawing.Size(0, 461); this.panelPacsImg.TabIndex = 5; // // flowLayoutPanelPacsImg @@ -2005,7 +2010,7 @@ this.flowLayoutPanelPacsImg.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanelPacsImg.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanelPacsImg.Name = "flowLayoutPanelPacsImg"; - this.flowLayoutPanelPacsImg.Size = new System.Drawing.Size(144, 461); + this.flowLayoutPanelPacsImg.Size = new System.Drawing.Size(0, 461); this.flowLayoutPanelPacsImg.TabIndex = 0; // // panelPacsRptList @@ -2090,7 +2095,7 @@ this.tabPageReport.Image = global::PEIS.Properties.Resources.menu; this.tabPageReport.Margin = new System.Windows.Forms.Padding(2); this.tabPageReport.Name = "tabPageReport"; - this.tabPageReport.Size = new System.Drawing.Size(448, 467); + this.tabPageReport.Size = new System.Drawing.Size(110, 467); this.tabPageReport.Text = "其他报告"; // // panelReportBase @@ -2100,7 +2105,7 @@ this.panelReportBase.Dock = System.Windows.Forms.DockStyle.Fill; this.panelReportBase.Location = new System.Drawing.Point(0, 0); this.panelReportBase.Name = "panelReportBase"; - this.panelReportBase.Size = new System.Drawing.Size(448, 467); + this.panelReportBase.Size = new System.Drawing.Size(110, 467); this.panelReportBase.TabIndex = 0; // // panelReport @@ -2111,7 +2116,7 @@ this.panelReport.Dock = System.Windows.Forms.DockStyle.Fill; this.panelReport.Location = new System.Drawing.Point(260, 0); this.panelReport.Name = "panelReport"; - this.panelReport.Size = new System.Drawing.Size(188, 467); + this.panelReport.Size = new System.Drawing.Size(0, 467); this.panelReport.TabIndex = 2; // // PictureBoxReportExt @@ -2186,9 +2191,25 @@ // this.tabPageHistory.Margin = new System.Windows.Forms.Padding(2); this.tabPageHistory.Name = "tabPageHistory"; - this.tabPageHistory.Size = new System.Drawing.Size(448, 467); + this.tabPageHistory.Size = new System.Drawing.Size(110, 467); this.tabPageHistory.Text = "历史结果"; // + // tabPageResult + // + this.tabPageResult.Controls.Add(this.panel6); + this.tabPageResult.Name = "tabPageResult"; + this.tabPageResult.PageVisible = false; + this.tabPageResult.Size = new System.Drawing.Size(110, 467); + this.tabPageResult.Text = "本次体检结果"; + // + // panel6 + // + this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(110, 467); + this.panel6.TabIndex = 0; + // // panelPatientInfo // this.panelPatientInfo.BackColor = System.Drawing.Color.White; @@ -2974,6 +2995,7 @@ ((System.ComponentModel.ISupportInitialize)(this.PictureBoxReportExt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DgcRptExt)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DgvRptExt)).EndInit(); + this.tabPageResult.ResumeLayout(false); this.panelPatientInfo.ResumeLayout(false); this.panel3.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); @@ -3204,5 +3226,7 @@ private System.Windows.Forms.ToolStripMenuItem TsmiOccupational; private DevExpress.XtraGrid.Columns.GridColumn gridColumn33; private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit repositoryItemCheckEdit1; + private DevExpress.XtraTab.XtraTabPage tabPageResult; + private System.Windows.Forms.Panel panel6; } } \ No newline at end of file diff --git a/PEIS/View/Exam/TotalForm.cs b/PEIS/View/Exam/TotalForm.cs index 7acbd84..4a4a57a 100644 --- a/PEIS/View/Exam/TotalForm.cs +++ b/PEIS/View/Exam/TotalForm.cs @@ -250,6 +250,20 @@ namespace PEIS.View.Exam DgvExamConclusion.OptionsBehavior.Editable = true; // 设置行头自动调整高度以显示勾选框 DgvExamConclusion.OptionsView.RowAutoHeight = true; + + this.InitResultView(); + } + + private void InitResultView() + { + string _resultView = Global._lstConfig.FirstOrDefault(p => p.Key == "TotalResultView")?.Value; + if (_resultView == "1") + { + splitExamPart.Panel1Collapsed = true; + tabPageResult.PageVisible = true; + DgcExamResultData.Dock = DockStyle.Fill; + panel6.Controls.Add(DgcExamResultData); + } } private void ConclusionSort(int i) @@ -745,10 +759,12 @@ namespace PEIS.View.Exam break; case @"历史结果": - AddHistoryView(); historyView.SearchHistory(_patient.CardNo); break; + + case @"检查结果": + break; } } diff --git a/PEIS/View/Setting/PackForm.cs b/PEIS/View/Setting/PackForm.cs index 99533cb..3fc3b4c 100644 --- a/PEIS/View/Setting/PackForm.cs +++ b/PEIS/View/Setting/PackForm.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using DevExpress.XtraGrid.Views.Grid.ViewInfo; +using DevExpress.XtraGrid.Views.Grid; namespace PEIS.View.Setting { @@ -34,8 +35,9 @@ namespace PEIS.View.Setting MenuPack.TsmiSave.Click += MenuPackSave_Click; MenuPack.TsmiDelete.Click += MenuPackDelete_Click; MenuPack.TsmiExport.Click += MenuPackExport_Click; - DgvPack.SelectionChanged += DgvPack_SelectionChanged; + // DgvPack.SelectionChanged += DgvPack_SelectionChanged; DgvPack.CellValueChanged += DgvPack_CellValueChanged; + DgvPack.Click += DgvPack_Click; MenuPack.TsmiRefresh.Click += (s, e) => { OnGetPackItem(); @@ -178,6 +180,27 @@ namespace PEIS.View.Setting if (DgvPack.GetRow(e.RowHandle) is Pack item && item.ID > 0) _lstPackChange.Add(item.ID); } + + /// + /// 点击套餐行 + /// + /// + /// + private void DgvPack_Click(object sender, EventArgs e) + { + /*int index = DgvPack.GetFocusedDataSourceRowIndex(); + DgvPack.SelectRow(index);*/ + if (DgvPack.GetFocusedRow() is Pack pack && pack.ID > 0) + { + PackNameTxt.Text = pack.Name; + OnGetFeeItemByPack(pack.ID); + } + else + { + PackNameTxt.Text = ""; + } + } + #endregion diff --git a/PEIS/View/UControl/HistoryView.cs b/PEIS/View/UControl/HistoryView.cs index a24d747..1e208c9 100644 --- a/PEIS/View/UControl/HistoryView.cs +++ b/PEIS/View/UControl/HistoryView.cs @@ -74,28 +74,44 @@ namespace PEIS.View.UControl Patient = patients.FirstOrDefault(); lblPatientName.Text = Patient.Name; } - var sql = $@" - WITH TextResultCTE AS ( - SELECT E.RptItemName, E.PID, - STUFF((SELECT ',' + t2.TextResult FROM Exam_Result t2 - WHERE t2.RptItemName = E.RptItemName AND t2.PID = E.PID - FOR XML PATH('')), 1, 1, '') AS TextResult - FROM Exam_Result E GROUP BY E.RptItemName, E.PID - ) - SELECT - A.ExamDate,B.EID,B.DeptCode,B.DeptName,B.FeeItemName,D.VerifyTime,E.RptItemName, - CASE WHEN TR.TextResult IS NOT NULL THEN TR.TextResult + ' ' + E.Unit ELSE TR.TextResult END AS TextResult - FROM Enrollment_Patient A - LEFT JOIN Enrollment_FeeItem B ON A.ID = B.EID - LEFT JOIN Dict_ReportItem C ON C.FID = B.FID - LEFT JOIN Exam_Part D ON B.EID = D.EID AND B.DeptCode = D.DeptCode - LEFT JOIN Exam_Result E ON E.PID = D.ID AND E.RID = C.ID - LEFT JOIN TextResultCTE TR ON TR.RptItemName = E.RptItemName AND TR.PID = E.PID - WHERE - A.SignTime IS NOT NULL - AND A.CardNo LIKE '{cardNo}' - AND D.VerifyTime IS NOT NULL - ORDER BY RptItemName, ExamDate, DeptName, FeeItemName;"; + //var sql = $@" + // WITH TextResultCTE AS ( + // SELECT E.RptItemName, E.PID, + // STUFF((SELECT ',' + t2.TextResult FROM Exam_Result t2 + // WHERE t2.RptItemName = E.RptItemName AND t2.PID = E.PID + // FOR XML PATH('')), 1, 1, '') AS TextResult + // FROM Exam_Result E GROUP BY E.RptItemName, E.PID + // ) + // SELECT + // A.ExamDate,B.EID,B.DeptCode,B.DeptName,B.FeeItemName,D.VerifyTime,E.RptItemName, + // CASE WHEN TR.TextResult IS NOT NULL THEN TR.TextResult + ' ' + E.Unit ELSE TR.TextResult END AS TextResult + // FROM Enrollment_Patient A + // LEFT JOIN Enrollment_FeeItem B ON A.ID = B.EID + // LEFT JOIN Dict_ReportItem C ON C.FID = B.FID + // LEFT JOIN Exam_Part D ON B.EID = D.EID AND B.DeptCode = D.DeptCode + // LEFT JOIN Exam_Result E ON E.PID = D.ID AND E.RID = C.ID + // LEFT JOIN TextResultCTE TR ON TR.RptItemName = E.RptItemName AND TR.PID = E.PID + // WHERE + // A.SignTime IS NOT NULL + // AND A.CardNo LIKE '{cardNo}' + // AND D.VerifyTime IS NOT NULL + // ORDER BY RptItemName, ExamDate, DeptName, FeeItemName;"; + var sql = $@"select + a.ExamDate + ,a.ID + ,b.DeptCode + ,b.DeptName + ,c.FeeItemName + ,b.VerifyTime + ,c.RptItemName + ,CASE WHEN c.TextResult IS NOT NULL THEN c.TextResult + ' ' + c.Unit ELSE c.TextResult END AS TextResult +from Enrollment_Patient a +left join Exam_Part b on b.EID = a.ID +left join Exam_Result c on c.PID = b.ID +where a.SignTime is not null +and a.CardNo LIKE '533103198603294034' +and b.VerifyTime is not null +ORDER BY c.RptItemName, a.ExamDate, b.DeptName, c.FeeItemName;"; // AND A.ExamDate BETWEEN '{beg}' AND '{end}' var data = DAOHelp.GetDataBySQL(sql).ToList(); @@ -130,8 +146,7 @@ namespace PEIS.View.UControl // 填充日期和EID组合的值 dayList.ForEach(i => { - var textResult = group.FirstOrDefault(p => p.ExamDate == i.ExamDate && p.EID == i.EID) - ?.TextResult ?? ""; + var textResult = group.FirstOrDefault(p => p.ExamDate == i.ExamDate && p.EID == i.EID)?.TextResult ?? ""; newRow[$"{i.ExamDate:yyyy-MM-dd}({i.EID})"] = textResult; }); }); @@ -139,13 +154,11 @@ namespace PEIS.View.UControl dgcHistory.DataSource = null; dgcHistory.DataSource = dtLeft; SetWidth(); - // dgvHistory.BestFitColumns(); dgvHistory.RowHeight = 40; dgcHistory.RefreshDataSource(); dgvHistory.BestFitColumns(); dgcHistory.Refresh(); dgcHistory.Invalidate(); - dgvHistory.Invalidate(); this.Invalidate(); }