我一直在尝试通过刀片添加多个数据。在我的边栏选项卡窗体中,我使用克隆,添加行。例如,一个申请具有许多物料。
我的边栏选项卡视图
刀片视图代码
<form autocomplete="off" method="POST" action="{{ route("requisition.store") }}" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label class="required" for="purpose">Purpose</label>
<input class="form-control" type="text" name="purpose" id="purpose" required>
<span class="help-block"></span>
</div>
<div class="form-group">
<label class="required" for="requisition_date">Date</label>
<input class="form-control" type="date" name="requisition_date" id="requisition_date" required>
<span class="help-block"></span>
</div>
<div class="form-group">
<label class="required" for="requested_by">Released By</label>
<input class="form-control" type="text" name="requested_by" id="requested_by" required>
<span class="help-block"></span>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>Qty</th>
<th>Unit</th>
<th>Description</th>
<th>
<a href="#" class="addRow"><i class="fas fa-plus"></i></a>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="number" name="rows[0][qty]" class="form-control quantity" required>
</td>
<td>
<input type="text" name="rows[0][unit]" class="form-control" required>
</td>
<td>
<input type="text" name="rows[0][description]" class="form-control" required>
</td>
<td>
</td>
</tr>
</tbody>
</table>
繁华开满天机