|
@@ -407,16 +407,16 @@
|
|
|
@csrf
|
|
@csrf
|
|
|
<div>
|
|
<div>
|
|
|
<label for="ttn_order_number" class="form-label">Номер заявки</label>
|
|
<label for="ttn_order_number" class="form-label">Номер заявки</label>
|
|
|
- <input type="text" class="form-control mb-3" id="ttn_order_number" name="order_number" placeholder="Номер заявки">
|
|
|
|
|
|
|
+ <input type="text" class="form-control mb-3" id="ttn_order_number" name="order_number" placeholder="Номер заявки" required>
|
|
|
|
|
|
|
|
<label for="ttn_order_date" class="form-label">Дата заявки</label>
|
|
<label for="ttn_order_date" class="form-label">Дата заявки</label>
|
|
|
- <input type="date" class="form-control mb-3" id="ttn_order_date" name="order_date" value="{{ date('Y-m-d') }}">
|
|
|
|
|
|
|
+ <input type="date" class="form-control mb-3" id="ttn_order_date" name="order_date" value="{{ date('Y-m-d') }}" required>
|
|
|
|
|
|
|
|
<label for="ttn_departure_date" class="form-label">Дата выезда</label>
|
|
<label for="ttn_departure_date" class="form-label">Дата выезда</label>
|
|
|
- <input type="date" class="form-control mb-3" id="ttn_departure_date" name="departure_date" value="{{ $order->installation_date ?? '' }}">
|
|
|
|
|
|
|
+ <input type="date" class="form-control mb-3" id="ttn_departure_date" name="departure_date" value="{{ $order->installation_date ?? '' }}" required>
|
|
|
|
|
|
|
|
<label for="ttn_order_sum" class="form-label">Сумма</label>
|
|
<label for="ttn_order_sum" class="form-label">Сумма</label>
|
|
|
- <input type="number" class="form-control mb-3" id="ttn_order_sum" name="order_sum" placeholder="Сумма" value="0">
|
|
|
|
|
|
|
+ <input type="number" class="form-control mb-3" id="ttn_order_sum" name="order_sum" placeholder="Сумма" value="0" required>
|
|
|
<button type="button" class="btn btn-primary" id="createTtn">Создать ТН</button>
|
|
<button type="button" class="btn btn-primary" id="createTtn">Создать ТН</button>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
@@ -537,6 +537,11 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$('#createTtn').on('click', function () {
|
|
$('#createTtn').on('click', function () {
|
|
|
|
|
+ const ttnForm = document.getElementById('ttnForm');
|
|
|
|
|
+ if (!ttnForm.reportValidity()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$('#ttnForm input[name="skus[]"]').remove();
|
|
$('#ttnForm input[name="skus[]"]').remove();
|
|
|
let ids = Array();
|
|
let ids = Array();
|
|
|
$('.check-maf').each(function () {
|
|
$('.check-maf').each(function () {
|
|
@@ -547,7 +552,7 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (ids.length) {
|
|
if (ids.length) {
|
|
|
- $('#ttnForm').submit();
|
|
|
|
|
|
|
+ ttnForm.submit();
|
|
|
} else {
|
|
} else {
|
|
|
customAlert('Нужно выбрать МАФ для ТН!');
|
|
customAlert('Нужно выбрать МАФ для ТН!');
|
|
|
}
|
|
}
|