5ba9fde10f
Warranty job UI changes to make consistent with plans for Repair Logging
160 lines
6.2 KiB
Plaintext
160 lines
6.2 KiB
Plaintext
@model Disco.Web.Models.Job.LogWarrantyModel
|
|
@{
|
|
Authorization.Require(Claims.Job.Actions.LogWarranty);
|
|
|
|
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty");
|
|
}
|
|
@using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
|
|
{
|
|
@Html.ValidationSummary(true)
|
|
@Html.HiddenFor(m => m.JobId)
|
|
@Html.ValidationMessageFor(m => m.JobId)
|
|
<input type="hidden" name="WarrantyAction" value="@(Model.IsCustomProvider ? "Custom" : "Disclose")" />
|
|
<div id="warrantyJobForm" class="form" style="width: 650px">
|
|
<table>
|
|
<tr>
|
|
<th>Internal Job Id:
|
|
</th>
|
|
<td>
|
|
@Model.JobId
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Device Serial Number:
|
|
</th>
|
|
<td>
|
|
@Model.Job.Device.SerialNumber
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Device Model:
|
|
</th>
|
|
<td>
|
|
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Technician:
|
|
</th>
|
|
<td>
|
|
@Model.TechUser.DisplayName
|
|
<div class="smallMessage">
|
|
Email Address: @Model.TechUser.EmailAddress<br />
|
|
Phone Number: @Model.TechUser.PhoneNumber
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th style="width: 150px">Repair Address:
|
|
</th>
|
|
<td>
|
|
@Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br />
|
|
@Html.ValidationMessageFor(m => m.OrganisationAddressId)
|
|
<div id="organisationAddressDetails">
|
|
@{
|
|
var oa = Model.OrganisationAddress;
|
|
if (oa != null)
|
|
{
|
|
<span>@oa.Address</span>
|
|
<br />
|
|
<span>@oa.Suburb, @oa.Postcode</span>
|
|
<br />
|
|
<span>@oa.State, @oa.Country</span>
|
|
}
|
|
}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Warranty Provider:
|
|
</th>
|
|
<td>
|
|
@Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, true, InstructionMessage: "Select a Provider", AdditionalItems: new Dictionary<string, string>() { { "CUSTOM", "<Custom Provider>" } }))<br />
|
|
@Html.ValidationMessageFor(m => m.WarrantyProviderId)
|
|
</td>
|
|
</tr>
|
|
@if (Model.IsCustomProvider)
|
|
{
|
|
<tr>
|
|
<th>Custom Provider:</th>
|
|
<td>
|
|
@Html.EditorFor(model => model.CustomProviderName)<br />
|
|
@Html.ValidationMessageFor(m => m.CustomProviderName)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Provider Job Reference:</th>
|
|
<td>
|
|
@Html.EditorFor(model => model.CustomProviderReference)<br />
|
|
@Html.ValidationMessageFor(m => m.CustomProviderReference)
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
</div>
|
|
<div id="warrantyJobFaultDescription" class="form" style="width: 650px; margin-top: 15px;">
|
|
<h2>Fault Description</h2>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
@Html.EditorFor(model => model.FaultDescription)<br />
|
|
@Html.ValidationMessageFor(m => m.FaultDescription)
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
|
|
{
|
|
<div id="warrantyJobProviderProperties">
|
|
@Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel)
|
|
</div>
|
|
}
|
|
<div class="actionBar">
|
|
@if (Model.IsCustomProvider)
|
|
{
|
|
<input type="submit" class="button" value="Save Warranty Claim" />
|
|
}
|
|
else
|
|
{
|
|
<input type="submit" class="button" value="Preview Warranty Claim" />
|
|
}
|
|
</div>
|
|
}
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var $providerId = $('#WarrantyProviderId');
|
|
var $addressId = $('#OrganisationAddressId');
|
|
|
|
function updateDetails() {
|
|
$('<form>').attr({
|
|
action: $providerId.closest('form').attr('action'),
|
|
method: 'post'
|
|
}).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'WarrantyAction', value: 'Update' })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'JobId', value: $('#JobId').val() })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'WarrantyProviderId', value: $providerId.val() })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'OrganisationAddressId', value: $addressId.val() })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'FaultDescription', value: $('#FaultDescription').val() })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'CustomProviderName', value: $('#CustomProviderName').val() })
|
|
).append(
|
|
$('<input>').attr({ type: 'hidden', name: 'CustomProviderReference', value: $('#CustomProviderReference').val() })
|
|
).appendTo('body').submit();
|
|
}
|
|
|
|
$providerId.change(updateDetails);
|
|
$addressId.change(updateDetails);
|
|
|
|
var customProvider = $('#CustomProviderName');
|
|
if (customProvider.length > 0 && !customProvider.val()) {
|
|
customProvider.focus();
|
|
} else {
|
|
$('#FaultDescription').focus();
|
|
}
|
|
});
|
|
</script>
|