Files
ayanova7/source/ri/ri/Views/Customer/ClientCSR.cshtml
2018-06-29 19:47:36 +00:00

144 lines
6.1 KiB
Plaintext

@model ri.Models.ShowAllCustomerCSRCriteriaModel
@using ri.util;
@using GZTW.AyaNova.BLL;
@{
ViewBag.Title = ay.lt("ClientServiceRequest.Label.List") + " " + Model.objectName;
}
<h2>
@Model.objectName</h2>
@using (Html.BeginForm())
{
<input type="hidden" name="hdObjectId" id="hdObjectId" value="@Model.objectId" />
<input type="hidden" name="hdheadOffice" id="hdheadOffice" value="@Model.headOffice.ToString()" />
<input type="hidden" name="hdobjectName" id="hdobjectName" value="@Model.objectName" />
<div class="panel panel-default">
<div class="panel-heading ">
<h2 class="panel-title">
<label for="ckFilter">
@ay.lt("UI.Label.Filtered")</label>
@ay.edCheckBox("ckFilter", Model.filter, ViewBag, false)
</h2>
</div>
@{
string pnlClass = "panel-body";
if (!Model.filter)
{
pnlClass += " collapse";
}
}
<div id="ayCritPanel" class="@pnlClass">
<div class="row">
@ay.edSelectGroup("Common.Label.Created", "plCreatedDateRange", ay.DateRangeList(), Model.createdDateRange, ViewBag)
@ay.edSelectGroup("ClientServiceRequest.Label.Priority", "plPriority", ay.CSRPriorityList(), Model.csrPriority, ViewBag)
@ay.edSelectGroup("ClientServiceRequest.Label.Status", "plStatus", ay.CSRStatusList(), Model.csrStatus, ViewBag)
@if (Model.headOffice)
{
@ay.edAutocomplete("O.Client", "ClientID", Model.clientID, Url, "headofficeclients:" + Model.objectId.ToString(), ViewBag)
@ay.edAutocomplete("Unit.Label.Serial", "UnitID", Model.unitID, Url, "headofficeunits:" + Model.objectId.ToString(), ViewBag)
}
else
{
@ay.edAutocomplete("Unit.Label.Serial", "UnitID", Model.unitID, Url, "clientunits:" + Model.objectId.ToString(), ViewBag)
}
</div>
</div>
</div>
<div class="row">
@ay.edSelectGroup("ClientServiceRequest.Label.List", "plMaxRecords", ay.RecordCountList(), Model.maxRecords, ViewBag)
</div>
<div>
<button type="submit" class="@ay.standardButtonClasses("btn-primary")">
@ay.lt("UI.Toolbar.Refresh")
<span class="glyphicon glyphicon-refresh"></span>
</button>
</div>
<br />
}
@{
ClientServiceRequestListRI theList = Model.list();
@ay.listBackButton();
@ay.listNewButton(ViewBag);
<div class="ay-display-list">
<ul class="list-group">
@foreach (ClientServiceRequestListRI.ClientServiceRequestListRIInfo i in theList)
{
<li class="list-group-item">
<h3 class="list-group-item-heading">
<a href="@ay.ClientUserCSRUrl(i.LT_O_ClientServiceRequest.Value, Url)">@i.LT_O_ClientServiceRequest.Display</a>
</h3>
@if (Model.headOffice)
{
@ay.AyPageDisplayListItemWrapper("O.Client", i.LT_O_Client, true)
}
@ay.AyPageDisplayListItemWrapper("Common.Label.Created", i.LT_Common_Label_Created, true)
@{
string sStatus = string.Empty;
if (i.LT_ClientServiceRequest_Label_Status == ClientServiceRequestStatus.Accepted)
{
sStatus = "(" + @ay.lt("O.Workorder") + " " + i.LT_O_Workorder + ")";
}
string sPriorityColor = "color:orange";
switch (i.LT_ClientServiceRequest_Label_Priority)
{
case ClientServiceRequestPriority.ASAP:
sPriorityColor = "color:DarkOrange";
break;
case ClientServiceRequestPriority.Emergency:
sPriorityColor = "color:Red";
break;
case ClientServiceRequestPriority.NotUrgent:
sPriorityColor = "color:DarkGreen";
break;
}
}
@if (ViewBag.canReport)
{
@ay.AyPageDisplayListItemWrapper("ClientServiceRequest.Label.Status", i.LT_ClientServiceRequest_Label_Status + "&nbsp; <a href=\"" + ay.ClientUserWOReportUrl(i.LT_O_Workorder.Value, Url) + "\">" + sStatus + "</a>", true)
}
else
{
@ay.AyPageDisplayListItemWrapper("ClientServiceRequest.Label.Status", i.LT_ClientServiceRequest_Label_Status, true)
}
@ay.AyPageDisplayListItemWrapper("ClientServiceRequest.Label.Priority", "<span style=\"" + sPriorityColor + "\">" + i.LT_ClientServiceRequest_Label_Priority + "</span>", true)
@ay.AyPageDisplayListItemWrapper("Unit.Label.Serial", i.LT_Unit_Label_Serial, !string.IsNullOrWhiteSpace(i.LT_Unit_Label_Serial.Display))
</li>
}
</ul>
</div>
@ay.listNewButton(ViewBag);
@ay.listBackButton();
}
<script>
$(document).ready(function () {
$("#ckFilter").click(function () {
if (!this.checked) {
$("#ayCritPanel").addClass("collapse");
} else {
$("#ayCritPanel").removeClass("collapse");
}
});
$("#UnitID").change(function (ev) {
if ($("#UnitID").val() != "00000000-0000-0000-0000-000000000000") {
ayClearInput('ClientID', 'auto');
}
});
$("#ClientID").change(function (ev) {
if ($("#ClientID").val() != "00000000-0000-0000-0000-000000000000") {
ayClearInput('UnitID', 'auto');
}
});
});
</script>