WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

70 lines
4.1 KiB
PHP

@php
$isEdit = $account->exists;
$isBank = $platform === 'bank';
$titleKey = $isBank ? 'bank_accounts' : $platform . '_accounts';
@endphp
<x-layouts.admin>
<x-slot name="title">
{{ $isEdit ? trans('general.edit') : trans('general.add_new') }}{{ trans('fund_accounts.' . $titleKey) }}
</x-slot>
<x-slot name="content">
<x-form.container>
<form method="POST" action="{{ $isEdit ? route('fund-accounts.update', [$platform, $account]) : route('fund-accounts.store', $platform) }}" class="space-y-6">
@csrf
@if ($isEdit)
@method('PATCH')
@endif
<div class="grid gap-5 sm:grid-cols-2">
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.company_name') }}</label>
<input name="company_name" value="{{ old('company_name', $account->company_name) }}" required class="w-full border rounded-lg px-3 py-2" />
</div>
@unless ($isBank)
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.account_name') }}</label>
<input name="account_name" value="{{ old('account_name', $account->account_name) }}" required class="w-full border rounded-lg px-3 py-2" />
</div>
@endunless
@if ($isBank)
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.bank_name') }}</label>
<input name="bank_name" value="{{ old('bank_name', $account->bank_name) }}" required class="w-full border rounded-lg px-3 py-2" />
</div>
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.bank_type') }}</label>
<input name="bank_type" value="{{ old('bank_type', $account->bank_type) }}" required class="w-full border rounded-lg px-3 py-2" />
</div>
@endif
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.account_number') }}</label>
<input name="account_number" value="{{ old('account_number', $account->account_number) }}" required class="w-full border rounded-lg px-3 py-2" />
</div>
<div>
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.reserved_phone') }}</label>
<input name="reserved_phone" value="{{ old('reserved_phone', $account->reserved_phone) }}" class="w-full border rounded-lg px-3 py-2" />
</div>
<div class="sm:col-span-2">
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.login_password') }}</label>
<input type="password" name="login_password" class="w-full border rounded-lg px-3 py-2" autocomplete="new-password" />
@if ($isEdit)
<p class="mt-2 text-xs text-gray-500">{{ trans('fund_accounts.password_hint') }}</p>
@endif
</div>
<div class="sm:col-span-2">
<label class="block text-sm font-medium mb-2">{{ trans('fund_accounts.notes') }}</label>
<textarea name="notes" rows="4" class="w-full border rounded-lg px-3 py-2">{{ old('notes', $account->notes) }}</textarea>
</div>
</div>
<div class="flex justify-end gap-4">
<a href="{{ route('fund-accounts.platform.index', $platform) }}" class="px-5 py-2 text-gray-600">{{ trans('general.cancel') }}</a>
<button type="submit" class="bg-green hover:bg-green-700 text-white px-5 py-2 rounded-lg">{{ trans('general.save') }}</button>
</div>
</form>
</x-form.container>
</x-slot>
</x-layouts.admin>