panliang 2024-04-28 22:51:13 +08:00
parent 308eab0e60
commit a69c3cc8e3
4 changed files with 18 additions and 2 deletions

View File

@ -54,4 +54,20 @@ enum CheckStatus: int
{ {
return data_get(self::options(), $this->value); return data_get(self::options(), $this->value);
} }
public function options2()
{
return [
self::None->value => '待提审',
self::Processing->value => '待审核',
self::Success->value => '已通过',
self::Fail->value => '已拒绝',
self::Cancel->value => '已取消',
];
}
public function text2()
{
return data_get(self::options2(), $this->value);
}
} }

View File

@ -36,7 +36,7 @@ class ReimbursementController extends Controller
$validated = $request->validate( $validated = $request->validate(
rules: [ rules: [
'reimbursement_type_id' => ['bail', 'required', Rule::exists(Keyword::class, 'key')], 'reimbursement_type_id' => ['bail', 'required', Rule::exists(Keyword::class, 'key')],
'expense' => ['bail', 'required', 'numeric', 'min:0'], 'expense' => ['bail', 'required', 'min:0', 'decimal:0,2'],
'reason' => ['bail', 'required', 'max:255'], 'reason' => ['bail', 'required', 'max:255'],
'photos' => ['bail', 'required', 'array'], 'photos' => ['bail', 'required', 'array'],
], ],

View File

@ -24,6 +24,7 @@ class WorkflowLogResource extends JsonResource
'check_name' => $this->check_name, 'check_name' => $this->check_name,
'check_user_id' => $this->check_user_id, 'check_user_id' => $this->check_user_id,
'checked_at' => $this->checked_at?->timestamp, 'checked_at' => $this->checked_at?->timestamp,
'checked_format' => $this->checked_at?->format('Y-m-d H:i:s'),
'remarks' => $this->remarks, 'remarks' => $this->remarks,
'check_status' => $this->check_status, 'check_status' => $this->check_status,
'check_status_text' => $this->check_status->text(), 'check_status_text' => $this->check_status->text(),

View File

@ -26,7 +26,6 @@ class EmployeeFactory extends Factory
$adminUser = AdminUser::create([ $adminUser = AdminUser::create([
'username' => $phone, 'username' => $phone,
// 123456
'password' => AdminUser::where('id', 1)->value('password'), 'password' => AdminUser::where('id', 1)->value('password'),
'name' => $name, 'name' => $name,
]); ]);