Last commit before showcase.
This commit is contained in:
parent
953ff38d64
commit
ad8b3c07e1
|
|
@ -30,10 +30,10 @@ public function build($options = null)
|
|||
$newCases = $data->pluck('count')->toArray();
|
||||
|
||||
return $this->chart->areaChart()
|
||||
->setTitle('Cases during last six months.')
|
||||
->addData('New cases', $newCases)
|
||||
->setTitle('Novi primeri zadnjih šest mesecev.')
|
||||
->addData('Primeri', $newCases)
|
||||
//->addData('Completed', [7, 2, 7, 2, 5, 4])
|
||||
->setColors(['#1A56DB', '#ff6384'])
|
||||
->setColors(['#ff6384'])
|
||||
->setXAxis($months)
|
||||
->setToolbar(true)
|
||||
->toVue();
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ public function store(Request $request)
|
|||
'full_name' => $pq['full_name'],
|
||||
'gender' => null,
|
||||
'birthday' => null,
|
||||
'tax_number' => null,
|
||||
'social_security_number' => null,
|
||||
'description' => 'sdwwf',
|
||||
'tax_number' => $pq['tax_number'],
|
||||
'social_security_number' => $pq['social_security_number'],
|
||||
'description' => $pq['description'],
|
||||
'group_id' => 2,
|
||||
'type_id' => 1
|
||||
]);
|
||||
|
|
@ -73,6 +73,12 @@ public function store(Request $request)
|
|||
'type_id' => $pq['address']['type_id']
|
||||
]);
|
||||
|
||||
$person->phones()->create([
|
||||
'nu' => $pq['phone']['nu'],
|
||||
'country_code' => $pq['phone']['country_code'],
|
||||
'type_id' => $pq['phone']['type_id']
|
||||
]);
|
||||
|
||||
$person->clientCase()->create([
|
||||
'client_id' => $client->id
|
||||
]);
|
||||
|
|
@ -147,11 +153,11 @@ public function deleteContract(ClientCase $clientCase, String $uuid, Request $re
|
|||
public function show(ClientCase $clientCase)
|
||||
{
|
||||
$case = $clientCase::with([
|
||||
'person' => fn($que) => $que->with('addresses')
|
||||
'person' => fn($que) => $que->with(['addresses', 'phones'])
|
||||
])->where('active', 1)->findOrFail($clientCase->id);
|
||||
|
||||
return Inertia::render('Cases/Show', [
|
||||
'client' => $case->client()->with('person', fn($q) => $q->with(['addresses']))->firstOrFail(),
|
||||
'client' => $case->client()->with('person', fn($q) => $q->with(['addresses', 'phones']))->firstOrFail(),
|
||||
'client_case' => $case,
|
||||
'contracts' => $case->contracts()
|
||||
->with(['type'])
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public function index(Client $client, Request $request){
|
|||
public function show(Client $client, Request $request) {
|
||||
|
||||
$data = $client::query()
|
||||
->with(['person' => fn($que) => $que->with('addresses')])
|
||||
->with(['person' => fn($que) => $que->with(['addresses','phones'])])
|
||||
->findOrFail($client->id);
|
||||
|
||||
return Inertia::render('Client/Show', [
|
||||
|
|
@ -56,6 +56,7 @@ public function store(Request $request)
|
|||
|
||||
DB::transaction(function() use ($request){
|
||||
$address = $request->input('address');
|
||||
$phone = $request->input('phone');
|
||||
$person = \App\Models\Person\Person::create([
|
||||
'nu' => rand(100000,200000),
|
||||
'first_name' => $request->input('first_name'),
|
||||
|
|
@ -63,9 +64,9 @@ public function store(Request $request)
|
|||
'full_name' => $request->input('full_name'),
|
||||
'gender' => null,
|
||||
'birthday' => null,
|
||||
'tax_number' => null,
|
||||
'social_security_number' => null,
|
||||
'description' => 'sdwwf',
|
||||
'tax_number' => $request->input('tax_number'),
|
||||
'social_security_number' => $request->input('social_security_number'),
|
||||
'description' => $request->input('description'),
|
||||
'group_id' => 1,
|
||||
'type_id' => 2
|
||||
]);
|
||||
|
|
@ -76,6 +77,12 @@ public function store(Request $request)
|
|||
'type_id' => $address['type_id']
|
||||
]);
|
||||
|
||||
$person->phones()->create([
|
||||
'nu' => $phone['nu'],
|
||||
'country_code' => $phone['country_code'],
|
||||
'type_id' => $phone['type_id']
|
||||
]);
|
||||
|
||||
$person->client()->create();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,29 @@ class PersonPhone extends Model
|
|||
/** @use HasFactory<\Database\Factories\Person/PersonPhoneFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'nu',
|
||||
'country_code',
|
||||
'type_id',
|
||||
'description',
|
||||
'person_id',
|
||||
'user_id'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'user_id',
|
||||
'person_id',
|
||||
'deleted'
|
||||
];
|
||||
|
||||
protected static function booted(){
|
||||
static::creating(function (PersonPhone $personPhone) {
|
||||
if(!isset($personPhone->user_id)){
|
||||
$personPhone->user_id = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function person(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Person\Person::class);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ public function run(): void
|
|||
];
|
||||
|
||||
$personGroups = [
|
||||
[ 'name' => 'client', 'description' => '', 'color_tag' => 'blue-400'],
|
||||
[ 'name' => 'client case', 'description' => '', 'color_tag' => 'red-400']
|
||||
[ 'name' => 'naročnik', 'description' => '', 'color_tag' => 'blue-400'],
|
||||
[ 'name' => 'primer naročnika', 'description' => '', 'color_tag' => 'red-400']
|
||||
];
|
||||
|
||||
$phoneTypes = [
|
||||
|
|
|
|||
|
|
@ -24,11 +24,18 @@ const props = defineProps({
|
|||
<p class="text-sm leading-5 md:text-sm text-gray-500">Social security NU.</p>
|
||||
<p class="text-sm md:text-base leading-7 text-gray-900">{{ person.social_security_number }}</p>
|
||||
</div>
|
||||
<div class="md:col-span-full lg:col-span-2 rounded p-2 shadow">
|
||||
|
||||
</div>
|
||||
<div class="grid grid-rows-* grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 mt-1">
|
||||
<div class="rounded p-2 shadow">
|
||||
<p class="text-sm leading-5 md:text-sm text-gray-500">Address</p>
|
||||
<p class="text-sm md:text-base leading-7 text-gray-900">{{ person.address }}</p>
|
||||
<p class="text-sm md:text-base leading-7 text-gray-900">{{ person.main_address }}</p>
|
||||
</div>
|
||||
<div class="md:col-span-full lg:col-span-2 rounded p-2 shadow">
|
||||
<div class="rounded p-2 shadow">
|
||||
<p class="text-sm leading-5 md:text-sm text-gray-500">Phone</p>
|
||||
<p class="text-sm md:text-base leading-7 text-gray-900">{{ person.main_phone }}</p>
|
||||
</div>
|
||||
<div class="md:col-span-full lg:col-span-1 rounded p-2 shadow">
|
||||
<p class="text-sm leading-5 md:text-sm text-gray-500">Description</p>
|
||||
<p class="text-sm md:text-base leading-7 text-gray-900">{{ person.description }}</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ watch(search, debounce((value) => {
|
|||
|
||||
</script>
|
||||
<template>
|
||||
<TextInput v-model="search" title="Search" placeholder="Search..." />
|
||||
<TextInput v-model="search" title="Search" placeholder="Iskanje..." />
|
||||
</template>
|
||||
|
|
@ -42,23 +42,23 @@ const logout = () => {
|
|||
<!-- Navigation Links -->
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
||||
<NavLink :href="route('dashboard')" :active="route().current('dashboard')">
|
||||
Dashboard
|
||||
Nadzorna plošča
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
||||
<NavLink :href="route('client')" :active="route().current('client') || route().current('client.*')">
|
||||
Clients
|
||||
Naročniki
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
||||
<NavLink :href="route('clientCase')" :active="route().current('clientCase') || route().current('clientCase.*')">
|
||||
Cases
|
||||
Primeri
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
||||
<NavLink :href="route('settings')" :active="route().current('settings') || route().current('settings.*')">
|
||||
Settings
|
||||
Nastavitve
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -85,11 +85,11 @@ const logout = () => {
|
|||
<template #content>
|
||||
<!-- Account Management -->
|
||||
<div class="block px-4 py-2 text-xs text-gray-400">
|
||||
Manage Account
|
||||
Nastavitve računa
|
||||
</div>
|
||||
|
||||
<DropdownLink :href="route('profile.show')">
|
||||
Profile
|
||||
Profil
|
||||
</DropdownLink>
|
||||
|
||||
<DropdownLink v-if="$page.props.jetstream.hasApiFeatures" :href="route('api-tokens.index')">
|
||||
|
|
@ -101,7 +101,7 @@ const logout = () => {
|
|||
<!-- Authentication -->
|
||||
<form @submit.prevent="logout">
|
||||
<DropdownLink as="button">
|
||||
Log Out
|
||||
Izpis
|
||||
</DropdownLink>
|
||||
</form>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -72,16 +72,16 @@ const store = () => {
|
|||
:show="show"
|
||||
@close="close"
|
||||
>
|
||||
<template #title>Add activity</template>
|
||||
<template #title>Dodaj aktivnost</template>
|
||||
<template #content>
|
||||
<form @submit.prevent="store">
|
||||
<SectionTitle class="mt-4 border-b mb-4">
|
||||
<template #title>
|
||||
Activity
|
||||
Aktivnost
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="activityDueDate" value="Due date"/>
|
||||
<InputLabel for="activityDueDate" value="Datum zapadlosti"/>
|
||||
<vue-date-picker
|
||||
id="activityDueDate"
|
||||
:enable-time-picker="false"
|
||||
|
|
@ -91,7 +91,7 @@ const store = () => {
|
|||
/>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="activityAmount" value="Amount"/>
|
||||
<InputLabel for="activityAmount" value="Znesek"/>
|
||||
<TextInput
|
||||
id="activityAmount"
|
||||
ref="activityAmountinput"
|
||||
|
|
@ -102,7 +102,7 @@ const store = () => {
|
|||
/>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="activityAction" value="Action"/>
|
||||
<InputLabel for="activityAction" value="Akcija"/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="activityAction"
|
||||
|
|
@ -114,7 +114,7 @@ const store = () => {
|
|||
</select>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="activityDecision" value="Decision"/>
|
||||
<InputLabel for="activityDecision" value="Odločitev"/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="activityDecision"
|
||||
|
|
@ -127,7 +127,7 @@ const store = () => {
|
|||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<FwbTextarea
|
||||
label="Note"
|
||||
label="Opomba"
|
||||
id="activityNote"
|
||||
ref="activityNoteTextarea"
|
||||
v-model="form.note"
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ const props = defineProps({
|
|||
|
||||
|
||||
let header = [
|
||||
C_TD.make('Date', 'header'),
|
||||
C_TD.make('Action', 'header'),
|
||||
C_TD.make('Decision', 'header'),
|
||||
C_TD.make('Note', 'header'),
|
||||
C_TD.make('Due date', 'header'),
|
||||
C_TD.make('Amount', 'header')
|
||||
C_TD.make('Datum', 'header'),
|
||||
C_TD.make('Akcija', 'header'),
|
||||
C_TD.make('Odločitev', 'header'),
|
||||
C_TD.make('Opomba', 'header'),
|
||||
C_TD.make('Datum zapadlosti', 'header'),
|
||||
C_TD.make('Znesek obljube', 'header')
|
||||
];
|
||||
|
||||
const createBody = (data) => {
|
||||
|
|
|
|||
|
|
@ -52,16 +52,16 @@ const storeContract = () => {
|
|||
:show="show"
|
||||
@close="close"
|
||||
>
|
||||
<template #title>Add contract</template>
|
||||
<template #title>Dodaj pogodbo</template>
|
||||
<template #content>
|
||||
<form @submit.prevent="storeContract">
|
||||
<SectionTitle class="mt-4 border-b mb-4">
|
||||
<template #title>
|
||||
Contract
|
||||
Pogodba
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="contractRef" value="Reference"/>
|
||||
<InputLabel for="contractRef" value="Referenca"/>
|
||||
<TextInput
|
||||
id="contractRef"
|
||||
ref="contractRefInput"
|
||||
|
|
@ -72,11 +72,11 @@ const storeContract = () => {
|
|||
/>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="contractStartDate" value="Start date"/>
|
||||
<InputLabel for="contractStartDate" value="Datum pričetka"/>
|
||||
<vue-date-picker id="contractStartDate" :enable-time-picker="false" format="dd.MM.yyyy" class="mt-1 block w-full" v-model="formContract.start_date"></vue-date-picker>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="contractTypeSelect" value="Contract type"/>
|
||||
<InputLabel for="contractTypeSelect" value="Tip"/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="contractTypeSelect"
|
||||
|
|
@ -88,11 +88,11 @@ const storeContract = () => {
|
|||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<ActionMessage :on="formContract.recentlySuccessful" class="me-3">
|
||||
Saved.
|
||||
Shranjuje.
|
||||
</ActionMessage>
|
||||
|
||||
<PrimaryButton :class="{ 'opacity-25': formContract.processing }" :disabled="formContract.processing">
|
||||
Save
|
||||
Shrani
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const props = defineProps({
|
|||
//Contract table
|
||||
let tableContractHeader = [
|
||||
C_TD.make('Ref.', 'header'),
|
||||
C_TD.make('Start date', 'header'),
|
||||
C_TD.make('Type', 'header')
|
||||
C_TD.make('Datum začetka', 'header'),
|
||||
C_TD.make('Tip', 'header')
|
||||
];
|
||||
|
||||
const tableOptions = {
|
||||
|
|
@ -34,7 +34,7 @@ const tableOptions = {
|
|||
ref: 'contractRefUInput',
|
||||
bind: 'reference',
|
||||
type: 'text',
|
||||
label: 'Reference',
|
||||
label: 'Referenca',
|
||||
autocomplete: 'contract-reference'
|
||||
},
|
||||
{
|
||||
|
|
@ -42,7 +42,7 @@ const tableOptions = {
|
|||
ref: 'contractTypeSelectU',
|
||||
bind: 'type_id',
|
||||
type: 'select',
|
||||
label: 'Type',
|
||||
label: 'Tip',
|
||||
selectOptions: props.contract_types.map(item => new Object({val: item.id, desc: item.name}))
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -21,14 +21,23 @@ const props = defineProps({
|
|||
|
||||
console.log(props.actions);
|
||||
|
||||
//Client and case person info card
|
||||
const clientMainAddress = props.client.person.addresses.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const personMainAddress = props.client_case.person.addresses.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const getMainAddress = (adresses) => {
|
||||
const addr = adresses.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const country = addr.country !== '' ? ` - ${addr.country}` : '';
|
||||
return addr.address !== '' ? addr.address + country : '';
|
||||
}
|
||||
|
||||
const getMainPhone = (phones) => {
|
||||
const pho = phones.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const countryCode = pho.country_code !== null ? `+${pho.country_code} ` : '';
|
||||
return pho.nu !== '' ? countryCode + pho.nu: '';
|
||||
}
|
||||
|
||||
const clientInfo = new Object({
|
||||
nu: props.client.person.nu,
|
||||
full_name: props.client.person.full_name,
|
||||
main_address: (clientMainAddress.country !== '') ? `${clientMainAddress.address} - ${clientMainAddress.country}` : clientMainAddress.address,
|
||||
main_address: getMainAddress(props.client.person.addresses),
|
||||
main_phone: getMainPhone(props.client.person.phones),
|
||||
tax_number: props.client.person.tax_number,
|
||||
social_security_number: props.client.person.social_security_number,
|
||||
description: props.client.person.description
|
||||
|
|
@ -37,7 +46,8 @@ const clientInfo = new Object({
|
|||
const casePersonInfo = new Object({
|
||||
nu: props.client_case.person.nu,
|
||||
full_name: props.client_case.person.full_name,
|
||||
main_address: (personMainAddress.country !== '') ? `${personMainAddress.address} - ${personMainAddress.country}` : personMainAddress.address,
|
||||
main_address: getMainAddress(props.client_case.person.addresses),
|
||||
main_phone: getMainPhone(props.client_case.person.phones),
|
||||
tax_number: props.client_case.person.tax_number,
|
||||
social_security_number: props.client_case.person.social_security_number,
|
||||
description: props.client_case.person.description
|
||||
|
|
@ -77,7 +87,7 @@ const closeDrawer = () => {
|
|||
<SectionTitle>
|
||||
<template #title>
|
||||
<FwbA class= "hover:text-blue-500" :href="route('client.show', client)">
|
||||
Client
|
||||
{{ clientInfo.full_name }}
|
||||
</FwbA>
|
||||
</template>
|
||||
|
||||
|
|
@ -101,7 +111,7 @@ const closeDrawer = () => {
|
|||
<div class="mx-auto max-w-4x1 p-3">
|
||||
<SectionTitle>
|
||||
<template #title>
|
||||
Case
|
||||
Primer - oseba
|
||||
</template>
|
||||
|
||||
</SectionTitle>
|
||||
|
|
@ -125,10 +135,10 @@ const closeDrawer = () => {
|
|||
<div class="flex justify-between p-3">
|
||||
<SectionTitle>
|
||||
<template #title>
|
||||
Contracts
|
||||
Pogodbe
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<FwbButton @click="openDrawerCreateContract">Add new</FwbButton>
|
||||
<FwbButton @click="openDrawerCreateContract">Nova</FwbButton>
|
||||
</div>
|
||||
<ContractTable
|
||||
:client_case="client_case"
|
||||
|
|
@ -146,10 +156,10 @@ const closeDrawer = () => {
|
|||
<div class="flex justify-between p-3">
|
||||
<SectionTitle>
|
||||
<template #title>
|
||||
Activities
|
||||
Aktivnosti
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<FwbButton @click="openDrawerAddActivity">Add new</FwbButton>
|
||||
<FwbButton @click="openDrawerAddActivity">Nova</FwbButton>
|
||||
</div>
|
||||
<ActivityTable
|
||||
:client_case="client_case"
|
||||
|
|
|
|||
|
|
@ -23,11 +23,21 @@ const Address = {
|
|||
type_id: 1
|
||||
};
|
||||
|
||||
const Phone = {
|
||||
nu: '',
|
||||
country_code: '00386',
|
||||
type_id: 1
|
||||
}
|
||||
|
||||
const formClient = useForm({
|
||||
first_name: '',
|
||||
last_name: '',
|
||||
full_name: '',
|
||||
address: Address
|
||||
tax_number: '',
|
||||
social_security_number: '',
|
||||
description: '',
|
||||
address: Address,
|
||||
phone: Phone
|
||||
});
|
||||
|
||||
//Create client drawer
|
||||
|
|
@ -72,7 +82,7 @@ const storeClient = () => {
|
|||
<AppLayout title="Client">
|
||||
<template #header>
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
Clients
|
||||
Naročniki
|
||||
</h2>
|
||||
</template>
|
||||
<div class="py-12">
|
||||
|
|
@ -80,7 +90,7 @@ const storeClient = () => {
|
|||
<div class="px-3 bg-white overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<div class="mx-auto max-w-4x1 py-3">
|
||||
<div class="flex justify-between">
|
||||
<PrimaryButton @click="openDrawerCreateClient" class="bg-blue-400">Add client</PrimaryButton>
|
||||
<PrimaryButton @click="openDrawerCreateClient" class="bg-blue-400">Dodaj</PrimaryButton>
|
||||
<SearchInput :options="search" />
|
||||
</div>
|
||||
<List class="mt-2">
|
||||
|
|
@ -95,7 +105,7 @@ const storeClient = () => {
|
|||
<div class="hidden shrink-0 sm:flex sm:flex-col sm:items-end">
|
||||
<p class="text-sm leading-6 text-gray-900">{{ client.person.tax_number }}</p>
|
||||
<div class="mt-1 flex items-center gap-x-1.5">
|
||||
<p class="text-xs leading-5 text-gray-500">Client</p>
|
||||
<p class="text-xs leading-5 text-gray-500">Naročnik</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -111,36 +121,13 @@ const storeClient = () => {
|
|||
:show="drawerCreateClient"
|
||||
@close="drawerCreateClient = false"
|
||||
>
|
||||
<template #title>Add client</template>
|
||||
<template #title>Novi naročnik</template>
|
||||
<template #content>
|
||||
<form @submit.prevent="storeClient">
|
||||
<div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="firstname" value="First name"/>
|
||||
<TextInput
|
||||
id="firstname"
|
||||
ref="firstnameInput"
|
||||
v-model="formClient.first_name"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="first-name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="lastname" value="Last name"/>
|
||||
<TextInput
|
||||
id="lastname"
|
||||
ref="lastnameInput"
|
||||
v-model="formClient.last_name"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="last-name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="fullname" value="Full name"/>
|
||||
<InputLabel for="fullname" value="Naziv"/>
|
||||
<TextInput
|
||||
id="fullname"
|
||||
ref="fullnameInput"
|
||||
|
|
@ -152,7 +139,31 @@ const storeClient = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="address" value="Address"/>
|
||||
<InputLabel for="taxnumber" value="Davčna"/>
|
||||
<TextInput
|
||||
id="taxnumber"
|
||||
ref="taxnumberInput"
|
||||
v-model="formClient.tax_number"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="tax-number"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="socialSecurityNumber" value="Matična / Emšo"/>
|
||||
<TextInput
|
||||
id="socialSecurityNumber"
|
||||
ref="socialSecurityNumberInput"
|
||||
v-model="formClient.social_security_number"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="social-security-number"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="address" value="Naslov"/>
|
||||
<TextInput
|
||||
id="address"
|
||||
ref="addressInput"
|
||||
|
|
@ -164,7 +175,7 @@ const storeClient = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="addressCountry" value="Country"/>
|
||||
<InputLabel for="addressCountry" value="Država"/>
|
||||
<TextInput
|
||||
id="addressCountry"
|
||||
ref="addressCountryInput"
|
||||
|
|
@ -176,25 +187,65 @@ const storeClient = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="addressType" value="Address type"/>
|
||||
<InputLabel for="addressType" value="Vrsta naslova"/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="addressType"
|
||||
v-model="formClient.address.type_id"
|
||||
>
|
||||
<option value="1">Permanent</option>
|
||||
<option value="2">Temporary</option>
|
||||
<option value="1">Stalni</option>
|
||||
<option value="2">Začasni</option>
|
||||
<!-- ... -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="phoneCountyCode" value="Koda države tel."/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="phoneCountyCode"
|
||||
v-model="formClient.phone.country_code"
|
||||
>
|
||||
<option value="00386">+386 (Slovenija)</option>
|
||||
<option value="00385">+385 (Hrvaška)</option>
|
||||
<option value="0039">+39 (Italija)</option>
|
||||
<option value="0036">+39 (Madžarska)</option>
|
||||
<option value="0043">+43 (Avstrija)</option>
|
||||
<option value="00381">+381 (Srbija)</option>
|
||||
<option value="00387">+387 (Bosna in Hercegovina)</option>
|
||||
<option value="00382">+382 (Črna gora)</option>
|
||||
<!-- ... -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="phoneNu" value="Telefonska št."/>
|
||||
<TextInput
|
||||
id="phoneNu"
|
||||
ref="phoneNuInput"
|
||||
v-model="formClient.phone.nu"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="phone-nu"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="description" value="Opis"/>
|
||||
<TextInput
|
||||
id="description"
|
||||
ref="descriptionInput"
|
||||
v-model="formClient.description"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="description"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<ActionMessage :on="formClient.recentlySuccessful" class="me-3">
|
||||
Saved.
|
||||
Shranjeno.
|
||||
</ActionMessage>
|
||||
|
||||
<PrimaryButton :class="{ 'opacity-25': formClient.processing }" :disabled="formClient.processing">
|
||||
Save
|
||||
Shrani
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -29,11 +29,21 @@ const Address = {
|
|||
type_id: 1
|
||||
}
|
||||
|
||||
const Phone = {
|
||||
nu: '',
|
||||
country_code: '00386',
|
||||
type_id: 1
|
||||
}
|
||||
|
||||
const Person = {
|
||||
first_name: '',
|
||||
last_name: '',
|
||||
full_name: '',
|
||||
address: Address
|
||||
tax_number: '',
|
||||
social_security_number: '',
|
||||
description: '',
|
||||
address: Address,
|
||||
phone: Phone
|
||||
}
|
||||
|
||||
const formCreateCase = useForm({
|
||||
|
|
@ -59,12 +69,22 @@ const closeDrawer = () => {
|
|||
drawerCreateCase.value = false
|
||||
}
|
||||
|
||||
const mainAddress = props.client.person.addresses.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const getMainAddress = (adresses) => {
|
||||
const addr = adresses.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const country = addr.country !== '' ? ` - ${addr.country}` : '';
|
||||
return addr.address !== '' ? addr.address + country : '';
|
||||
}
|
||||
|
||||
const getMainPhone = (phones) => {
|
||||
const pho = phones.filter( a => a.type.id === 1 )[0] ?? '';
|
||||
const countryCode = pho.country_code !== null ? `+${pho.country_code} ` : '';
|
||||
return pho.nu !== '' ? countryCode + pho.nu: '';
|
||||
}
|
||||
const clientInfo = new Object({
|
||||
nu: props.client.person.nu,
|
||||
full_name: props.client.person.full_name,
|
||||
main_address: (mainAddress.country !== '') ? `${mainAddress.address} - ${mainAddress.country}` : mainAddress.address,
|
||||
main_address: getMainAddress(props.client.person.addresses),
|
||||
main_phone: getMainPhone(props.client.person.phones),
|
||||
tax_number: props.client.person.tax_number,
|
||||
social_security_number: props.client.person.social_security_number,
|
||||
description: props.client.person.description
|
||||
|
|
@ -92,7 +112,7 @@ const storeCase = () => {
|
|||
<div class="mx-auto max-w-4x1 p-3">
|
||||
<SectionTitle>
|
||||
<template #title>
|
||||
{{ client.person.full_name }} - client
|
||||
{{ client.person.full_name }}
|
||||
</template>
|
||||
|
||||
</SectionTitle>
|
||||
|
|
@ -115,7 +135,7 @@ const storeCase = () => {
|
|||
<div class="px-3 bg-white overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<div class="mx-auto max-w-4x1 py-3">
|
||||
<div class="flex justify-between">
|
||||
<PrimaryButton @click="openDrawerCreateCase" class="bg-blue-400">Add Case</PrimaryButton>
|
||||
<PrimaryButton @click="openDrawerCreateCase" class="bg-blue-400">Dodaj</PrimaryButton>
|
||||
<SearchInput :options="search" />
|
||||
</div>
|
||||
<List class="mt-2">
|
||||
|
|
@ -130,7 +150,7 @@ const storeCase = () => {
|
|||
<div class="hidden shrink-0 sm:flex sm:flex-col sm:items-end">
|
||||
<p class="text-sm leading-6 text-gray-900">{{ clientCase.person.nu }}</p>
|
||||
<div class="mt-1 flex items-center gap-x-1.5">
|
||||
<p class="text-xs leading-5 text-gray-500">Client case</p>
|
||||
<p class="text-xs leading-5 text-gray-500">Primer naročnika</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -146,40 +166,17 @@ const storeCase = () => {
|
|||
:show="drawerCreateCase"
|
||||
@close="drawerCreateCase = false">
|
||||
|
||||
<template #title>Add case</template>
|
||||
<template #title>Nova primer</template>
|
||||
<template #content>
|
||||
<form @submit.prevent="storeCase">
|
||||
<SectionTitle class="border-b mb-4">
|
||||
<template #title>
|
||||
Person
|
||||
Oseba
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="firstname" value="First name"/>
|
||||
<TextInput
|
||||
id="firstname"
|
||||
ref="firstnameInput"
|
||||
v-model="formCreateCase.person.first_name"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="first-name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="lastname" value="Last name"/>
|
||||
<TextInput
|
||||
id="lastname"
|
||||
ref="lastnameInput"
|
||||
v-model="formCreateCase.person.last_name"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="last-name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="fullname" value="Full name"/>
|
||||
<InputLabel for="fullname" value="Naziv"/>
|
||||
<TextInput
|
||||
id="fullname"
|
||||
ref="fullnameInput"
|
||||
|
|
@ -191,7 +188,31 @@ const storeCase = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="address" value="Address"/>
|
||||
<InputLabel for="taxnumber" value="Davčna"/>
|
||||
<TextInput
|
||||
id="taxnumber"
|
||||
ref="taxnumberInput"
|
||||
v-model="formCreateCase.tax_number"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="tax-number"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="socialSecurityNumber" value="Matična / Emšo"/>
|
||||
<TextInput
|
||||
id="socialSecurityNumber"
|
||||
ref="socialSecurityNumberInput"
|
||||
v-model="formCreateCase.social_security_number"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="social-security-number"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="address" value="Naslov"/>
|
||||
<TextInput
|
||||
id="address"
|
||||
ref="addressInput"
|
||||
|
|
@ -203,7 +224,7 @@ const storeCase = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="addressCountry" value="Country"/>
|
||||
<InputLabel for="addressCountry" value="Država"/>
|
||||
<TextInput
|
||||
id="addressCountry"
|
||||
ref="addressCountryInput"
|
||||
|
|
@ -215,24 +236,64 @@ const storeCase = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="addressType" value="Address type"/>
|
||||
<InputLabel for="addressType" value="Vrsta naslova"/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="addressType"
|
||||
v-model="formCreateCase.person.address.type_id"
|
||||
>
|
||||
<option value="1">Permanent</option>
|
||||
<option value="2">Temporary</option>
|
||||
<option value="1">Stalni</option>
|
||||
<option value="2">Začasni</option>
|
||||
<!-- ... -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="phoneCountyCode" value="Koda države tel."/>
|
||||
<select
|
||||
class="block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||||
id="phoneCountyCode"
|
||||
v-model="formCreateCase.person.phone.country_code"
|
||||
>
|
||||
<option value="00386">+386 (Slovenija)</option>
|
||||
<option value="00385">+385 (Hrvaška)</option>
|
||||
<option value="0039">+39 (Italija)</option>
|
||||
<option value="0036">+39 (Madžarska)</option>
|
||||
<option value="0043">+43 (Avstrija)</option>
|
||||
<option value="00381">+381 (Srbija)</option>
|
||||
<option value="00387">+387 (Bosna in Hercegovina)</option>
|
||||
<option value="00382">+382 (Črna gora)</option>
|
||||
<!-- ... -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="phoneNu" value="Telefonska št."/>
|
||||
<TextInput
|
||||
id="phoneNu"
|
||||
ref="phoneNuInput"
|
||||
v-model="formCreateCase.person.phone.nu"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="phone-nu"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<InputLabel for="description" value="Opis"/>
|
||||
<TextInput
|
||||
id="description"
|
||||
ref="descriptionInput"
|
||||
v-model="formCreateCase.description"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="description"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<ActionMessage :on="formCreateCase.recentlySuccessful" class="me-3">
|
||||
Saved.
|
||||
Shranjeno.
|
||||
</ActionMessage>
|
||||
|
||||
<PrimaryButton :class="{ 'opacity-25': formCreateCase.processing }" :disabled="formCreateCase.processing">
|
||||
Save
|
||||
Shrani
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ console.log(props.people)
|
|||
|
||||
|
||||
const tablePersonHeader = [
|
||||
C_TD.make('Nu.', 'header'),
|
||||
C_TD.make('Name', 'header'),
|
||||
C_TD.make('Group', 'header')
|
||||
C_TD.make('Št.', 'header'),
|
||||
C_TD.make('Naziv', 'header'),
|
||||
C_TD.make('Skupina', 'header')
|
||||
];
|
||||
|
||||
let tablePersonBody = [];
|
||||
|
|
@ -46,7 +46,7 @@ props.people.forEach((p) => {
|
|||
<AppLayout title="Dashboard">
|
||||
<template #header>
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
Dashboard
|
||||
Nadzorna plošča
|
||||
</h2>
|
||||
</template>
|
||||
<div class="pt-12 hidden md:block">
|
||||
|
|
@ -61,10 +61,10 @@ props.people.forEach((p) => {
|
|||
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<SectionTitle class="p-4">
|
||||
<template #title>
|
||||
Terrain
|
||||
Teren
|
||||
</template>
|
||||
<template #description>
|
||||
List of new contracts for terrain work
|
||||
Seznam primerov za terensko delo
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<BasicTable :header="tablePersonHeader" :body="tablePersonBody"></BasicTable>
|
||||
|
|
@ -72,10 +72,10 @@ props.people.forEach((p) => {
|
|||
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<SectionTitle class="p-4">
|
||||
<template #title>
|
||||
Last added
|
||||
Na novo dodano
|
||||
</template>
|
||||
<template #description>
|
||||
List of new people
|
||||
Seznam novih naročnikov (modra) / primerov (rdeča)
|
||||
</template>
|
||||
</SectionTitle>
|
||||
<BasicTable :header="tablePersonHeader" :body="tablePersonBody"></BasicTable>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user