164 lines
7.4 KiB
Plaintext
164 lines
7.4 KiB
Plaintext
@using MP.MONO.Data
|
|
@using MP.MONO.UI.Components
|
|
@using MP.MONO.Core.DTO
|
|
@using MP.MONO.UI.Data
|
|
|
|
@inject CurrentDataService MMDataService
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
|
|
<div class="card mb-5" style="box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;">
|
|
<div class="card-header bg-primary text-light">
|
|
<div class="d-flex justify-content-between col-12">
|
|
<div class="p-0 pt-1 col-6">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="d-flex justify-content-between">
|
|
<h5 class="pt-2 mx-2"><i class="fa-solid fa-screwdriver-wrench pe-2" aria-hidden="true"></i><b>MAINTENANCE'S TASK SETUP</b></h5>
|
|
<div class="pb-1 d-flex justify-content-between">
|
|
<div class="input-group">
|
|
<button class="btn btn-light btn-sm" id="btnShow" @onclick="() => ChangeMode()"><i class="fa-regular fa-circle-right"></i></button>
|
|
<button class="btn btn-light btn-sm" id="btnInfo" title="Scheduled tasks" disabled>
|
|
Click to return to pending Tasks
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group py-1">
|
|
<button class="btn btn-success btn-sm" @onclick="() => toggleAddNew()" title="@addNewMessage">
|
|
@addNewMessage
|
|
@if (showAddNew)
|
|
{
|
|
<i class="bi bi-caret-up-square"></i>
|
|
}
|
|
else
|
|
{
|
|
<i class="bi bi-caret-down-square"></i>
|
|
}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
@if (ListRecords == null)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-warning text-center display-4">No record found</div>
|
|
}
|
|
else
|
|
{
|
|
@if (showAddNew || showEdit)
|
|
{
|
|
<EditMaintTask currItem="@currRec" DataReset="() => ResetData()" DataUpdated="() => UpdateActivData()"></EditMaintTask>
|
|
}
|
|
<div class="d-flex">
|
|
<div class="@mainCssClass">
|
|
<table class="table table-sm table-striped table-responsive-lg small">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>ID</th>
|
|
@if (currPMTaskId == 0)
|
|
{
|
|
<th>Topic</th>
|
|
<th>Machine Group</th>
|
|
<th>Team in Charge</th>
|
|
<th>Counter Var</th>
|
|
<th>Expyre (H)</th>
|
|
}
|
|
<th>Job Description</th>
|
|
@if (currPMTaskId == 0)
|
|
{
|
|
<th class="text-end"># Exec</th>
|
|
<th></th>
|
|
}
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var record in ListRecords)
|
|
{
|
|
<tr class="@cssCheckSel(record.PMTaskId) @cssCheckDisabled(record.IsDisabled)">
|
|
<td>
|
|
@if (!record.IsDisabled)
|
|
{
|
|
<button class="btn btn-primary btn-sm" @onclick="() => EditRecord(record)" title="Edit"><i class="bi bi-pencil"></i></button>
|
|
}
|
|
</td>
|
|
<td class="text-nowrap">
|
|
@record.ExtIdx
|
|
</td>
|
|
@if (currPMTaskId == 0)
|
|
{
|
|
<td>@record.TopicNav.Description</td>
|
|
<td>@record.MachGroupNav.Description</td>
|
|
<td>@record.UserTeamNav.Description</td>
|
|
<td>@record.CounterNav.Description</td>
|
|
<td>@record.ExpiryVal</td>
|
|
}
|
|
|
|
<td>@record.JobDescription</td>
|
|
@if (currPMTaskId == 0)
|
|
{
|
|
<td class="text-end">@record.NumTaskDone</td>
|
|
}
|
|
<td>
|
|
@if (record.NumTaskDone > 0)
|
|
{
|
|
<button class="btn btn-success btn-sm" @onclick="() => ShowDetail(record)" title="Show History"><i class="bi bi-clock-history"></i></button>
|
|
}
|
|
</td>
|
|
@if (currPMTaskId == 0)
|
|
{
|
|
<td>
|
|
@if (!record.IsDisabled)
|
|
{
|
|
<button class="btn btn-danger btn-sm" @onclick="() => DeleteRecord(record)" title="Delete/Disable Task"><i class="bi bi-trash"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-warning btn-sm" @onclick="() => EnableRecord(record)" title="Re-enable Task"><i class="bi bi-check"></i></button>
|
|
}
|
|
</td>
|
|
}
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@if (currPMTaskId > 0)
|
|
{
|
|
<div class="p-2 flex-grow-1 small selBlock">
|
|
<MaintTaskExecHist currPMTaskId="@currPMTaskId" reqClose="() => ShowDetail(null)" currParentRec="@selRecord"></MaintTaskExecHist>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="card-footer py-0">
|
|
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
|
</div>
|
|
</div>
|
|
<style>
|
|
|
|
#btnInfo {
|
|
opacity: 0.0;
|
|
-webkit-transition: all 500ms ease-in-out;
|
|
-moz-transition: all 500ms ease-in-out;
|
|
-o-transition: all 500ms ease-in-out;
|
|
transition: all 500ms ease-in-out;
|
|
}
|
|
|
|
#btnShow:hover + #btnInfo {
|
|
opacity: 1.0;
|
|
}
|
|
</style>
|
|
|
|
|