| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Http\Requests\Procurement;
- use App\Traits\RequestApiFormValidation;
- use Illuminate\Foundation\Http\FormRequest;
- class ProcurementRequest extends FormRequest
- {
- use RequestApiFormValidation;
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules()
- {
- return [
- 'owner_id'=>'required',
- 'owner_material_id'=>'required',
- 'quantity'=>'required',
- 'amount'=>'required',
- ];
- }
- public function messages()
- {
- return [
- 'owner_id.required' => '项目必选',
- 'owner_material_id.required' => '项目耗材编码必选',
- 'quantity.required' => '采购数量不可为空',
- 'amount.required' => '销售数量不可为空',
- ];
- }
- }
|