采购单优化
This commit is contained in:
@@ -5,8 +5,7 @@ namespace App\Http\Requests\Purchase;
|
||||
use Modules\Common\Http\Requests\BaseFormRequest;
|
||||
|
||||
/**
|
||||
* 采购明细商品行修改 验证(C4;品名/供应商/包规/单位/成本/称重至少一项,
|
||||
* 提交后一键同步该商品在本采购单下的全部订货明细)
|
||||
* 采购明细商品行修改
|
||||
*/
|
||||
class PurchaseRowUpdateRequest extends BaseFormRequest
|
||||
{
|
||||
@@ -15,12 +14,11 @@ class PurchaseRowUpdateRequest extends BaseFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'product_name' => 'nullable|string|max:100',
|
||||
'supplier_id' => 'nullable|integer|exists:supplier,id',
|
||||
'product_spec' => 'nullable|string|max:100',
|
||||
'unit' => 'nullable|string|max:20',
|
||||
'cost_price' => 'nullable|numeric|min:0',
|
||||
'sync_product' => 'nullable|boolean',
|
||||
'product_name' => 'required|string|max:100',
|
||||
'supplier_id' => 'required|integer|exists:supplier,id',
|
||||
'product_spec' => 'required|string|max:100',
|
||||
'unit' => 'required|string|max:20',
|
||||
'cost_price' => 'required|numeric|min:0',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -28,11 +26,20 @@ class PurchaseRowUpdateRequest extends BaseFormRequest
|
||||
{
|
||||
return [
|
||||
'product_name.max' => '品名不能超过 100 字',
|
||||
'product_name.required' => '品名不能为空',
|
||||
'product_name.string' => '品名必须为字符串',
|
||||
'supplier_id.supplier_id' => '供应商不能为空',
|
||||
'supplier_id.integer' => '供应商格式错误',
|
||||
'supplier_id.exists' => '供应商不存在',
|
||||
'product_spec.required' => '包规不能为空',
|
||||
'product_spec.string' => '包规必须为字符串',
|
||||
'product_spec.max' => '包规不能超过 100 字',
|
||||
'unit.required' => '单位不能为空',
|
||||
'unit.string' => '单位必须为字符串',
|
||||
'unit.max' => '单位不能超过 20 字',
|
||||
'cost_price.numeric' => '采购成本必须为数字',
|
||||
'cost_price.min' => '采购成本不能小于 0',
|
||||
'cost_price.required' => '成本不能为空',
|
||||
'cost_price.numeric' => '成本必须为数字',
|
||||
'cost_price.min' => '成本不能小于 0',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user