|
|
@ -31,7 +31,7 @@ |
|
|
|
</div> |
|
|
|
<div class="form-group form-inline my-sm-1"> |
|
|
|
<label asp-for="LineID" class="control-label col-sm-3"></label> |
|
|
|
<select asp-for="LineID" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"> |
|
|
|
<select id="LineID" asp-for="LineID" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"> |
|
|
|
</select> |
|
|
|
<span asp-validation-for="LineID" class="text-danger offset-sm-3 my-sm-1"></span> |
|
|
|
</div> |
|
|
@ -42,7 +42,7 @@ |
|
|
|
</div> |
|
|
|
<div class="form-group form-inline my-sm-1"> |
|
|
|
<label asp-for="StationID" class="control-label col-sm-3"></label> |
|
|
|
<select asp-for="StationID" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"> |
|
|
|
<select id="StationID" asp-for="StationID" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"> |
|
|
|
<option value="">N/A</option> |
|
|
|
</select> |
|
|
|
<span asp-validation-for="StationID" class="text-danger offset-sm-3 my-sm-1"></span> |
|
|
@ -242,6 +242,12 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
$("#UnitNo").change(function () { |
|
|
|
var data = $("#UnitNo").val(); |
|
|
|
//console.info(data); |
|
|
|
getLines(data); |
|
|
|
getStations(data); |
|
|
|
}); |
|
|
|
|
|
|
|
function getUserInfoes(data) { |
|
|
|
$.ajax({ |
|
|
@ -340,6 +346,66 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
function getLines(data) { |
|
|
|
$.ajax({ |
|
|
|
url: "/BAS/GetLineInfoes", |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json", |
|
|
|
type: 'get', |
|
|
|
success: function (result) { |
|
|
|
if (result.data) { |
|
|
|
$("#LineID").empty(); |
|
|
|
$('#LineID').append(new Option("請選擇", "")); |
|
|
|
var count = 0; |
|
|
|
$.each(result.data, function (index, item) { |
|
|
|
if (item.unitNo == data) { |
|
|
|
$('#LineID').append(new Option(item.lineDesc, item.lineID)); |
|
|
|
count = count + 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
if (count == 0) { |
|
|
|
$("#LineID").empty(); |
|
|
|
$('#LineID').append(new Option("無選項", "")); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
$("#LineID").empty(); |
|
|
|
$('#LineID').append(new Option("無選項", "")); |
|
|
|
} |
|
|
|
layui.form.render("select"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
function getStations(data) { |
|
|
|
$.ajax({ |
|
|
|
url: "/BAS/GetStationses", |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json", |
|
|
|
type: 'get', |
|
|
|
success: function (result) { |
|
|
|
if (result.data) { |
|
|
|
$("#StationID").empty(); |
|
|
|
$('#StationID').append(new Option("請選擇", "")); |
|
|
|
var count = 0; |
|
|
|
$.each(result.data, function (index, item) { |
|
|
|
if (item.unitNo == data) { |
|
|
|
$('#StationID').append(new Option(item.stationName, item.stationID)); |
|
|
|
count = count + 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
if (count == 0) { |
|
|
|
$("#StationID").empty(); |
|
|
|
$('#StationID').append(new Option("無選項", "")); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
$("#StationID").empty(); |
|
|
|
$('#StationID').append(new Option("無選項", "")); |
|
|
|
} |
|
|
|
layui.form.render("select"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
layui.use(['laydate'], function () { |
|
|
|
//form = layui.form; |
|
|
|