php - 如何在 laravel 中验证动态行输入
问题描述
我正在为药房公司开发一个应用程序,产品有很多批次。创建新发票时。他们不会在发票项目列表中输入具有相同批号的相同产品。如何使用 laravel 规则进行验证。
我的刀片(动态行):
<tr class="item_row" id="item-row-0">
<td>
<select class="form-control boxed" name="items[0][product_id]" id="product_id0" onchange="productattribute(0)" data-width="100%" required>
<option value="">Select</option>
</select>
</td>
<td>
<select class="form-control boxed widthonefifty" name="items[0][batch_no]" id="batch_no0" onchange="setmaximumQuantity(0)" required>
<option value="">Select</option></select></td>
<td>
<input type="text" class="form-control boxed traitmbox" name="items[0][quantity]" id="quantity0" data-trigger="calculation" data-calculation="quantity" data-parsley-type="digits" data-parsley-trigger="keyup blur" max="0" required>
</td>
<td>
<input type="text" class="form-control boxed alnrit" name="items[0][product_amt]" id="product_amt0" data-calculation="productamt" tabindex="-1" readonly required>
<input type="hidden" class="form-control boxed" name="items[0][total_product_amt]" id="total_product_amt0" data-calculation="totalproductamt" readonly>
</td>
<td>
<input type="text" class="form-control boxed traitmbox" name="items[0][discount_rate]" id="discount_rate0" data-calculation="discount_rate" tabindex="-1" readonly>
<input type="hidden" class="form-control boxed" name="items[0][discount_amt]" id="discount_amt0" data-calculation="discount_amt" readonly>
<input type="hidden" class="form-control boxed" name="items[0][taxable_product_amt]" id="taxable_product_amt0" data-calculation="taxable_product_amt" readonly>
</td>
<td>
<input type="text" class="form-control boxed traitmbox alnrit" name="items[0][tax_rate]" id="tax_rate0" data-calculation="tax_rate" tabindex="-1" readonly>
<input type="hidden" class="form-control boxed" name="items[0][tax_amount]" id="tax_amount0" data-calculation="tax_amount" readonly>
</td>
<td>
<input type="text" class="form-control boxed alnrit" name="items[0][row_total]" id="row_total0" data-calculation="row_total" tabindex="-1" readonly required>
</td>
<td>
<a href="javascript:void(0);" onclick="removeRow(0);" tabindex="-1" style="float:left;"> <i class="fa fa-trash btn btn-danger"></i></a>
</td>
</tr>
解决方案
推荐阅读
- android - 如何在片段中实现 EmojiTextView?
- symfony - Symfony 4 - 注销时:注意:unserialize():偏移量 7899 处的错误,共 17631 个字节
- python - 获取具有字符串名称的对象的属性
- r - 在 R 中使用 gamm 或 lme 嵌套随机效果的语法
- java - setContentView() 没有按预期工作 - 为什么?
- git - 编辑器关闭时的 Git 提交钩子
- javascript - 仅将图层添加到脚本 CS6 版本 13 中的最后一个 PSD 文件错误
- javascript - ReactJs setState 不重新渲染
- git - 从 git-branch 重新隐藏远程分支
- python - Apache AIrflow KubernetesExecutor 和 KubernetesPodOperator:xcom 推送不起作用