物品扫码领用与库存
This commit is contained in:
@@ -15,6 +15,11 @@ class InvRequisitionValidate extends Validate
|
||||
'items' => 'require|array',
|
||||
'items.*.item_id' => 'require|number',
|
||||
'items.*.request_qty' => 'require|number|gt:0',
|
||||
// 扫码领取规则
|
||||
'item_id' => 'require|integer|gt:0',
|
||||
'qty' => 'require|integer|gt:0',
|
||||
// 管理员代领规则
|
||||
'target_user_id' => 'require|integer|gt:0',
|
||||
];
|
||||
|
||||
// 提示
|
||||
@@ -32,24 +37,53 @@ class InvRequisitionValidate extends Validate
|
||||
'items.*.request_qty.require' => '申请数量不能为空',
|
||||
'items.*.request_qty.number' => '申请数量格式错误',
|
||||
'items.*.request_qty.gt' => '申请数量必须大于0',
|
||||
'item_id.require' => '物品ID不能为空',
|
||||
'item_id.integer' => '物品ID必须为整数',
|
||||
'item_id.gt' => '物品ID必须大于0',
|
||||
'qty.require' => '领取数量不能为空',
|
||||
'qty.integer' => '领取数量必须为整数',
|
||||
'qty.gt' => '领取数量必须大于0',
|
||||
'target_user_id.require' => '代领用户不能为空',
|
||||
'target_user_id.integer' => '代领用户ID必须为整数',
|
||||
'target_user_id.gt' => '代领用户ID必须大于0',
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
'applicant_id',
|
||||
'borrow_reason',
|
||||
'use_start_date',
|
||||
'use_end_date',
|
||||
'items'
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
'applicant_id',
|
||||
'borrow_reason',
|
||||
'use_start_date',
|
||||
'use_end_date',
|
||||
'items'
|
||||
],
|
||||
|
||||
|
||||
'apply' => [
|
||||
'applicant_id',
|
||||
'borrow_reason',
|
||||
'use_start_date',
|
||||
'use_end_date',
|
||||
'items'
|
||||
]
|
||||
],
|
||||
|
||||
'qrClaim' => [
|
||||
'item_id',
|
||||
'qty',
|
||||
],
|
||||
|
||||
'proxyClaim' => [
|
||||
'item_id',
|
||||
'qty',
|
||||
'target_user_id',
|
||||
'borrow_reason',
|
||||
],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user