прописала контроллеры для привязки симптомов к лекарствам и получения отчета в ворде и экселе , еще что-то подправила для последнего (вместо радиобатонов сделала чекбоксы)

This commit is contained in:
Елена Бакальская 2024-05-28 18:46:06 +04:00
parent 9c97590f23
commit 58fbf0ac08
7 changed files with 53 additions and 35 deletions

View File

@ -1,10 +1,5 @@
using PolyclinicBusinessLogic.OfficePackage.HelperEnums;
using PolyclinicBusinessLogic.OfficePackage.HelperModels.Word;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PolyclinicBusinessLogic.OfficePackage
{

View File

@ -12,7 +12,7 @@ namespace PolyclinicContracts.BusinessLogicsContracts
public interface ISuretorReportLogic
{
/// <summary>
/// Получение списка компонент с указанием, в каких изделиях используются
/// Получение данных (списка) курсов - ну он получается один по выбранным процедурам
/// </summary>
/// <returns></returns>
List<ReportCoursesByProcedureViewModel> GetProcedureCourses(ProcedureSearchModel model);

View File

@ -276,12 +276,18 @@ namespace PolyclinicWebAppSuretor.Controllers
public IActionResult ListCoursesByProcedures()
{
return View();
List<ProcedureViewModel> procedures = _procedureLogic.ReadList(null);
return View(procedures);
}
public IActionResult AddSymptomToMedicament()
public IActionResult AddSymptomToMedicament(AddSymptomToMedicamentModel model)
{
return View();
model = new()
{
Medicaments = _medicamentLogic.ReadList(null),
Symptoms = _symptomLogic.ReadList(null)
};
return View(model);
}
[HttpGet]

View File

@ -0,0 +1,10 @@
using PolyclinicContracts.ViewModels;
namespace PolyclinicWebAppSuretor.Models
{
public class AddSymptomToMedicamentModel
{
public List<MedicamentViewModel> Medicaments { get; set; } = new();
public List<SymptomViewModel> Symptoms { get; set; } = new();
}
}

View File

@ -1,4 +1,6 @@
@using PolyclinicContracts.ViewModels
@model AddSymptomToMedicamentModel
@{
ViewData["Title"] = "AddSymptomToMedicament";
}
@ -7,12 +9,13 @@
<div class="row mb-2">
<div class="col-3 d-flex align-content-center">
<h5 class="me-2">Симптом: </h5>
<select id="symptomId" name="symptomId" class="me-2">
<option value="">Выберите симптом</option>
@{
for (int i = 1; i <= 10; i++)
foreach (var item in Model.Symptoms)
{
<option value="@i">Симптом номер @i</option>
<option value="@item.Id">@item.Name</option>
}
}
</select>
@ -21,12 +24,13 @@
<div class="row mb-2">
<div class="col-3 d-flex align-content-center">
<h5 class="me-2">Лекарство: </h5>
<select id="medicamentId" name="medicamentId" class="me-2">
<option value="">Выберите лекарство</option>
@{
for (int i = 1; i <= 10; i++)
foreach (var item in Model.Medicaments)
{
<option value="@i">лекарство @i</option>
<option value="@item.Id">@item.Name</option>
}
}
</select>

View File

@ -38,27 +38,30 @@
</select>
</div>
<div class="d-flex flex-row mb-5 justify-content-between align-items-center overflow-auto" style="max-height: 20vh">
<div class="d-flex flex-row mb-5 justify-content-between align-items-center">
<h3 class="col-3">
Выбор процедуры:
</h3>
<label value="">Выберите процедуру/ы</label>
<ol>
@foreach (var item in Model.Procedures)
{
<li>
@if (item.IsChecked)
{
<input type="checkbox" id="procedure-@item.procedure.Id" name="selectedProcedures" value="@item.procedure.Id" checked />
}
else
{
<input type="checkbox" id="procedure-@item.procedure.Id" name="selectedProcedures" value="@item.procedure.Id" />
}
<label for="procedure-@item.procedure.Id">@item.procedure.Name</label>
</li>
}
</ol>
<div class="overflow-auto" style="max-height: 20vh">
<ol>
@foreach (var item in Model.Procedures)
{
<li>
@if (item.IsChecked)
{
<input type="checkbox" id="procedure-@item.procedure.Id" name="selectedProcedures" value="@item.procedure.Id" checked />
}
else
{
<input type="checkbox" id="procedure-@item.procedure.Id" name="selectedProcedures" value="@item.procedure.Id" />
}
<label for="procedure-@item.procedure.Id">@item.procedure.Name</label>
</li>
}
</ol>
</div>
</div>
</div>

View File

@ -1,4 +1,5 @@
@using PolyclinicContracts.ViewModels
@model List<ProcedureViewModel>
@{
ViewData["Title"] = "ListCoursesByProcedures";
}
@ -10,17 +11,16 @@
<div class="procedure-info d-flex flex-column mb-5 mt-5">
<p style="font-size: 3vh">
Выберите процедуру из списка
Выберите процедуру из списка
</p>
<div class="list-procedures list-group overflow-auto">
<ul>
@{
int count = 20;
for (int i = 1; i <= count; i++)
foreach (var item in Model)
{
<li class="d-flex mb-2">
<input class="me-2" name="procedure-@i" type="radio" id="procedure-@i" />
<label for="diagnose-@i">процедура @i</label>
<input class="me-2" name="procedure-@item.Id" type="checkbox" id="procedure-@item.Id" />
<label for="procedure-@item.Id">@item.Name</label>
</li>
}
}