добавление отчётов, небольшие доделки

This commit is contained in:
Stepan 2024-04-30 17:51:06 +04:00
parent 6c30c6da83
commit 6d1651c534
14 changed files with 277 additions and 13 deletions

View File

@ -126,6 +126,15 @@ namespace ImplementerApp.Controllers
return View();
}
public IActionResult CarsPreSaleWorkReport()
{
return View(new List<CarsPreSaleWorkReportViewModel>());
}
public IActionResult EmployeeCompletionsReport()
{
return View(new List<CarsPeriodReportViewModel>());
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{

View File

@ -0,0 +1,50 @@
@using CarCenterContracts.ViewModels
@model List<CarsPeriodReportViewModel>
@{
ViewData["Title"] = "CarsPeriodReport";
}
<div class="text-center">
<h1 class="display-4">Список машин за период</h1>
</div>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Отправить отчет на почту</button>
</form>
<table class="table">
<thead>
<tr>
<th>Бренд машины</th>
<th>Комплектации</th>
<th>Сотрудники</th>
</tr>
</thead>
<tbody>
@foreach (var cars in Model)
{
<tr>
<td>@cars.CarBrand</td>
<td>
<ul>
@foreach (var completion in cars.Completions)
{
<li>@completion</li>
}
</ul>
</td>
<td>
<ul>
@foreach (var employee in cars.Employees)
{
<li>@employee</li>
}
</ul>
</td>
</tr>
}
</tbody>
</table>

View File

@ -0,0 +1,42 @@
@using CarCenterContracts.ViewModels
@model List<CarsPreSaleWorkReportViewModel>
@{
ViewData["Title"] = "CarsPreSaleWorkReport";
}
<div class="text-center">
<h1 class="display-4">Список машин по предпродажным работам</h1>
</div>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Word</button>
</form>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Excel</button>
</form>
<table class="table">
<thead>
<tr>
<th>Бренд машины</th>
<th>Предпродажная работа</th>
</tr>
</thead>
<tbody>
@foreach (var cars in Model)
{
<tr>
<td>@cars.CarBrand</td>
<td>
<ul>
@foreach (var presalework in cars.PreSaleWork)
{
<li>@presalework</li>
}
</ul>
</td>
</tr>
}
</tbody>
</table>

View File

@ -19,7 +19,7 @@
return;
}
<p>
<a asp-action="CreateCompletion">Создать комплектацию</a>
<a asp-action="CreateCompletions">Создать комплектацию</a>
</p>
<table class="table">
<thead>
@ -61,7 +61,7 @@
@Html.DisplayFor(modelItem => item.СompletionPrice)
</td>
<td>
<a asp-action="CreateCompletion" asp-route-id="@item.Id" class="btn btn-primary">Изменить</a>
<a asp-action="CreateCompletions" asp-route-id="@item.Id" class="btn btn-primary">Изменить</a>
</td>
<td>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Удалить</a>

View File

@ -5,8 +5,7 @@
<div class="text-center">
<h1 class="display-4">Список создания отчетов</h1>
<div class="list-group">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexCarSales">Продаваемые машины</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexCompletions">Комплектации</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexInspection">Осмотры</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="CarsPeriodReport">Отчет по машинам за период</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="CarsPreSaleWorkReport">Отчет по машинам и предпродажным работам</a>
</div>
</div>

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class CarsPeriodReportViewModel
{
public string CarBrand { get; set; } = string.Empty;
public List<string> Completions { get; set; } = new();
public List<string> Employees { get; set; } = new();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class CarsPreSaleWorkReportViewModel
{
public string CarBrand { get; set; } = string.Empty;
public List<string> PreSaleWork { get; set; } = new();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class SalesInspectionsReportViewModel
{
public string SaleName { get; set; } = string.Empty;
public List<string> Inspections { get; set; } = new();
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class SalesPeriodReportViewModel
{
public string SaleName { get; set; } = string.Empty;
public List<string> Employee { get; set; } = new();
public List<string> Completions { get; set; } = new();
}
}

View File

@ -126,7 +126,16 @@ namespace ImplementerApp.Controllers
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult SalesInspectionsReport()
{
return View(new List<SalesInspectionsReportViewModel>());
}
public IActionResult SalesPeriodReport()
{
return View(new List<SalesPeriodReportViewModel>());
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });

View File

@ -10,8 +10,16 @@
</div>
<form method="post">
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" name="title" id="title" /></div>
<div class="col-4">ФИО сотрудника:</div>
<div class="col-8"><input type="text" name="employeefio" id="employeefio" /></div>
</div>
<div class="row">
<div class="col-4">Должность сотрудника:</div>
<div class="col-8"><input type="text" name="employeepost" id="employeepost" /></div>
</div>
<div class="row">
<div class="col-4">Стоимость продажи:</div>
<div class="col-8"><input type="text" name="employeesalary" id="employeesalary" /></div>
</div>
<div class="container">
<div>Sales</div>
@ -37,10 +45,6 @@
</table>
</div>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>

View File

@ -5,6 +5,7 @@
<div class="text-center">
<h1 class="display-4">Список создания отчетов</h1>
<div class="list-group">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="SalesPeriodReport">Отчет по машинам за период</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="SalesInspectionsReport">Отчет по машинам и предпродажным работам</a>
</div>
</div>

View File

@ -0,0 +1,42 @@
@using CarCenterContracts.ViewModels
@model List<SalesInspectionsReportViewModel>
@{
ViewData["Title"] = "SalesInspectionsReport";
}
<div class="text-center">
<h1 class="display-4">Список осмотров по продажам </h1>
</div>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Word</button>
</form>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Excel</button>
</form>
<table class="table">
<thead>
<tr>
<th>Продажа</th>
<th>Осмотр</th>
</tr>
</thead>
<tbody>
@foreach (var sales in Model)
{
<tr>
<td>@sales.SaleName</td>
<td>
<ul>
@foreach (var inspections in sales.Inspections)
{
<li>@inspections</li>
}
</ul>
</td>
</tr>
}
</tbody>
</table>

View File

@ -0,0 +1,50 @@
@using CarCenterContracts.ViewModels
@model List<SalesPeriodReportViewModel>
@{
ViewData["Title"] = "SalesPeriodReport";
}
<div class="text-center">
<h1 class="display-4">Список продаж за период</h1>
</div>
<form asp-controller="Report" method="post">
<button type="submit" class="btn btn-primary">Отправить отчет на почту</button>
</form>
<table class="table">
<thead>
<tr>
<th>Продажа</th>
<th>Сотрудники</th>
<th>Комплектации</th>
</tr>
</thead>
<tbody>
@foreach (var sales in Model)
{
<tr>
<td>@sales.SaleName</td>
<td>
<ul>
@foreach (var employee in sales.Employee)
{
<li>@employee</li>
}
</ul>
</td>
<td>
<ul>
@foreach (var completion in sales.Completions)
{
<li>@completion</li>
}
</ul>
</td>
</tr>
}
</tbody>
</table>