обновлена таблица вознаграждений в админке
This commit is contained in:
parent
d2ceee50f5
commit
7fddfd54c7
@ -13,93 +13,90 @@
|
|||||||
|
|
||||||
|
|
||||||
class CreateClientForm extends Component
|
class CreateClientForm extends Component
|
||||||
{
|
{
|
||||||
const NEW = 1;
|
const NEW = 1;
|
||||||
const ERROR = 2;
|
const ERROR = 2;
|
||||||
const SUCCESS = 3;
|
const SUCCESS = 3;
|
||||||
const READY = 4;
|
const READY = 4;
|
||||||
public $client;
|
public $client;
|
||||||
public $complexes;
|
public $complexes;
|
||||||
public $status;
|
public $status;
|
||||||
public $result;
|
public $result;
|
||||||
public $agent;
|
public $agent;
|
||||||
protected $messages = [
|
protected $messages = [
|
||||||
'client.firstName.required' => 'Необходимо указать имя клиента',
|
'client.firstName.required' => 'Необходимо указать имя клиента',
|
||||||
'client.secondName.required' => 'Необходимо указать фамилию клиента',
|
'client.secondName.required' => 'Необходимо указать фамилию клиента',
|
||||||
'client.phone.required' => 'Необходимо указать телефон без кода страны "+7" или "8"',
|
'client.phone.required' => 'Необходимо указать телефон без кода страны "+7" или "8"',
|
||||||
'client.phone.regex' => 'Телефон должен содержать 10 симвлов без указания кода страны "+7" или "8"',
|
'client.phone.regex' => 'Телефон должен содержать 10 симвлов без указания кода страны "+7" или "8"',
|
||||||
'client.phone.unique' => 'Клиент с таким телефоном уже существует',
|
'client.phone.unique' => 'Клиент с таким телефоном уже существует',
|
||||||
'agent.integer' => 'Необходимо указать агента, от которого добавляется контакт'
|
'agent.integer' => 'Необходимо указать агента, от которого добавляется контакт'
|
||||||
];
|
];
|
||||||
protected function rules()
|
protected function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'agent' => ['required', 'integer'],
|
'agent' => ['required', 'integer'],
|
||||||
'client.firstName' => ['required', 'string', 'max:255'],
|
'client.firstName' => ['required', 'string', 'max:255'],
|
||||||
'client.secondName' => ['required', 'string', 'max:255'],
|
'client.secondName' => ['required', 'string', 'max:255'],
|
||||||
'client.phone' => ['required', 'string', 'regex:/\(?([0-9]{3})\)([-]{1})([0-9]{3})([-]{1})([0-9]{4})/i']
|
//'client.phone' => ['required', 'string', 'regex:/^(\+7)([0-9]{3})([-]{1})([0-9]{3})([-]{1})([0-9]{4})/i']
|
||||||
|
'client.phone' => ['required', 'string', 'regex:/^\+7 \d{3} \d{3}-\d{2}-\d{2}$/']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$userBroker = Agent::where('user_id', auth()->user()->id)->first();
|
$userBroker = Agent::where('user_id', auth()->user()->id)->first();
|
||||||
$this->complexes = Complex::all();
|
$this->complexes = Complex::all();
|
||||||
$this->client = [
|
$this->client = [
|
||||||
'firstName' => '',
|
'firstName' => '',
|
||||||
'secondName' => '',
|
'secondName' => '',
|
||||||
'phone' => '',
|
'phone' => '',
|
||||||
'complexId' => ''
|
'complexId' => ''
|
||||||
];
|
];
|
||||||
$this->status = self::NEW;
|
$this->status = self::NEW;
|
||||||
if ($agent = Agent::where('user_id', auth()->user()->id)->first())
|
if ($agent = Agent::where('user_id', auth()->user()->id)->first())
|
||||||
{
|
|
||||||
$this->agent = $agent->id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->agent = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public function update()
|
|
||||||
{
|
{
|
||||||
|
$this->agent = $agent->id;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->agent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public function updated($propertyName)
|
public function updated($propertyName)
|
||||||
{
|
{
|
||||||
$this->status = self::NEW;
|
$this->status = self::NEW;
|
||||||
if ($propertyName == 'client.phone')
|
if ($propertyName == 'client.phone')
|
||||||
{
|
{
|
||||||
//$this->dispatch('phone-updated', ['newPhone' => 111]);
|
//$this->dispatch('phone-updated', ['newPhone' => 111]);
|
||||||
//$this->js("checkPhoneFormat('123')");
|
//$this->js("checkPhoneFormat('123')");
|
||||||
$phone = preg_replace('/[^0-9]/', "", $this->client['phone']);
|
$phone = preg_replace('/[^0-9\+]+/', "", $this->client['phone']);
|
||||||
if (strlen($phone) == 10)
|
if (strlen($this->client['phone']) <= 2)
|
||||||
{
|
{
|
||||||
$sArea = substr($phone, 0, 3);
|
$this->client['phone'] = "+7";
|
||||||
$sPrefix = substr($phone, 3, 3);
|
}
|
||||||
$sNumber = substr($phone, 6, 4);
|
elseif (strlen($phone) <= 12)
|
||||||
$phone = "(" . $sArea . ")-" . $sPrefix . "-" . $sNumber;
|
{
|
||||||
$this->client['phone'] = $phone;
|
$code = substr($phone, 0, 2);
|
||||||
}
|
$sArea = substr($phone, 2, 3);
|
||||||
elseif (strlen($this->client['phone']) == 1)
|
$sPrefix = substr($phone, 5, 3);
|
||||||
{
|
$sNumber1 = substr($phone, 8, 2);
|
||||||
if ($this->client['phone'] == "8" || $this->client['phone'] == "7" || $this->client['phone'] == "+")
|
$sNumber2 = substr($phone, 10, 2);
|
||||||
{
|
|
||||||
$this->client['phone'] = null;
|
$phone = $code . " " . $sArea . " " . $sPrefix . "-" . $sNumber1 . "-" . $sNumber2;
|
||||||
}
|
$this->client['phone'] = $phone;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
$this->client['phone'] = $phone;
|
{
|
||||||
}
|
$this->client['phone'] = $phone;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->client['phone'] = $phone;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->validateOnly($propertyName);
|
|
||||||
}
|
}
|
||||||
|
$this->validateOnly($propertyName);
|
||||||
|
}
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
$this->client['firstName']
|
$this->client['firstName']
|
||||||
&& $this->client['secondName']
|
&& $this->client['secondName']
|
||||||
@ -107,95 +104,95 @@ public function render()
|
|||||||
&& $this->client['complexId']
|
&& $this->client['complexId']
|
||||||
&& $this->status == self::NEW
|
&& $this->status == self::NEW
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->status = self::READY;
|
$this->status = self::READY;
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'adminAccount' => false
|
'adminAccount' => false
|
||||||
];
|
];
|
||||||
if ($adminAccount = CompanyAdmin::where('user_id', auth()->user()->id)->first())
|
if ($adminAccount = CompanyAdmin::where('user_id', auth()->user()->id)->first())
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'adminAccount' => $adminAccount,
|
'adminAccount' => $adminAccount,
|
||||||
'agents' => Agent::where('company_id', $adminAccount->company_id)->get()
|
'agents' => Agent::where('company_id', $adminAccount->company_id)->get()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return view(
|
return view(
|
||||||
'livewire.create-client-form',
|
'livewire.create-client-form',
|
||||||
$data
|
$data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public function resetData()
|
public function resetData()
|
||||||
{
|
{
|
||||||
$this->mount();
|
$this->mount();
|
||||||
}
|
}
|
||||||
public function back()
|
public function back()
|
||||||
{
|
{
|
||||||
$this->status = self::NEW;
|
$this->status = self::NEW;
|
||||||
}
|
}
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
$validated = $this->validate($this->rules());
|
$validated = $this->validate($this->rules());
|
||||||
$phone = '+7' . $this->client['phone'];
|
$phone = '+7' . $this->client['phone'];
|
||||||
$newUser = User::updateOrCreate(
|
$newUser = User::updateOrCreate(
|
||||||
['phone' => $phone],
|
['phone' => $phone],
|
||||||
[
|
[
|
||||||
'name' => trim($this->client['firstName'] . ' ' . $this->client['secondName']),
|
'name' => trim($this->client['firstName'] . ' ' . $this->client['secondName']),
|
||||||
'phone' => $phone
|
'phone' => $phone
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data = [
|
$data = [
|
||||||
'agent_id' => $this->agent
|
'agent_id' => $this->agent
|
||||||
,
|
,
|
||||||
'client_id' => $newUser->id
|
'client_id' => $newUser->id
|
||||||
,
|
,
|
||||||
'complex_id' => $this->client['complexId']
|
'complex_id' => $this->client['complexId']
|
||||||
];
|
];
|
||||||
$data['confirm_token'] = $this->client['confirmToken'] = hash('sha256', json_encode($data));
|
$data['confirm_token'] = $this->client['confirmToken'] = hash('sha256', json_encode($data));
|
||||||
|
|
||||||
if ($newDeal = Deal::create($data))
|
if ($newDeal = Deal::create($data))
|
||||||
{
|
{
|
||||||
if ($bitrixId = $this->sendToBitrix($newDeal))
|
if ($bitrixId = $this->sendToBitrix($newDeal))
|
||||||
{
|
{
|
||||||
$newDeal->bitrix_id = $bitrixId;
|
$newDeal->bitrix_id = $bitrixId;
|
||||||
$newDeal->status = DealStatus::MODERATION;
|
$newDeal->status = DealStatus::MODERATION;
|
||||||
$newDeal->save();
|
$newDeal->save();
|
||||||
$this->result = $bitrixId;
|
$this->result = $bitrixId;
|
||||||
return $this->status = self::SUCCESS;
|
return $this->status = self::SUCCESS;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$newDeal->delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $this->status = self::ERROR;
|
else
|
||||||
|
{
|
||||||
|
$newDeal->delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return $this->status = self::ERROR;
|
||||||
|
}
|
||||||
public function sendToBitrix(Deal $deal)
|
public function sendToBitrix(Deal $deal)
|
||||||
{
|
{
|
||||||
//$user = auth()->user();
|
//$user = auth()->user();
|
||||||
//$agent = Agent::where(column: 'user_id', $user->id)->first();
|
//$agent = Agent::where(column: 'user_id', $user->id)->first();
|
||||||
$agent = $deal->agent;
|
$agent = $deal->agent;
|
||||||
$agentName = $agent->user->getPartialsName();
|
$agentName = $agent->user->getPartialsName();
|
||||||
$data = [
|
$data = [
|
||||||
'CLIENT_FIRST_NAME' => $this->client['firstName'],
|
'CLIENT_FIRST_NAME' => $this->client['firstName'],
|
||||||
'CLIENT_SECOND_NAME' => $this->client['secondName'],
|
'CLIENT_SECOND_NAME' => $this->client['secondName'],
|
||||||
'CLIENT_PHONE' => '+7' . $this->client['phone'],
|
'CLIENT_PHONE' => '+7' . $this->client['phone'],
|
||||||
'BROKER_FIRST_NAME' => $agentName['firstName'],
|
'BROKER_FIRST_NAME' => $agentName['firstName'],
|
||||||
'BROKER_SECOND_NAME' => $agentName['secondName'],
|
'BROKER_SECOND_NAME' => $agentName['secondName'],
|
||||||
'BROKER_PHONE' => $agent->user->phone,
|
'BROKER_PHONE' => $agent->user->phone,
|
||||||
'BROKER_INN' => $agent->company->inn,
|
'BROKER_INN' => $agent->company->inn,
|
||||||
'OBJECT_NAME' => Complex::find($this->client['complexId'])->name,
|
'OBJECT_NAME' => Complex::find($this->client['complexId'])->name,
|
||||||
'CALLBACK_URL' => route('api.client', ['hash' => $this->client['confirmToken']]),
|
'CALLBACK_URL' => route('api.client', ['hash' => $this->client['confirmToken']]),
|
||||||
];
|
];
|
||||||
$sender = new SendClient($deal->id, $data);
|
$sender = new SendClient($deal->id, $data);
|
||||||
$response = $sender->send();
|
$response = $sender->send();
|
||||||
if ($response)
|
if ($response)
|
||||||
{
|
{
|
||||||
return $response;
|
return $response;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -31,17 +31,11 @@ public function index(Request $request)
|
|||||||
'filter' => $request->filter
|
'filter' => $request->filter
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
public function edit(City $city)
|
|
||||||
{
|
|
||||||
return view('admin::companies.edit', [
|
|
||||||
'city' => $city,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request, City $city)
|
public function update(Request $request, City $city)
|
||||||
{
|
{
|
||||||
$city->update($request->only('name'));
|
$city->update($request->only('name'));
|
||||||
return to_route('admin.companies');
|
return back();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(Request $request)
|
public function create(Request $request)
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
use App\Models\Agent\Agent;
|
use App\Models\Agent\Agent;
|
||||||
class Payments extends Component
|
class Payments extends Component
|
||||||
{
|
{
|
||||||
public $value;
|
public $newValue;
|
||||||
public $companyId;
|
public $companyId;
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
@ -27,8 +27,8 @@ public function back()
|
|||||||
|
|
||||||
public function setPaymentValueForCompany(Company $company, Complex $complex)
|
public function setPaymentValueForCompany(Company $company, Complex $complex)
|
||||||
{
|
{
|
||||||
$company->setPayment($complex, $this->value);
|
$company->setPayment($complex, $this->newValue);
|
||||||
$this->value = null;
|
$this->newValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unsetPaymentForCompany(Company $company, Complex $complex)
|
public function unsetPaymentForCompany(Company $company, Complex $complex)
|
||||||
@ -38,14 +38,14 @@ public function unsetPaymentForCompany(Company $company, Complex $complex)
|
|||||||
|
|
||||||
public function setPaymentValueForAgent(Agent $agent, Complex $complex)
|
public function setPaymentValueForAgent(Agent $agent, Complex $complex)
|
||||||
{
|
{
|
||||||
$agent->setPayment($complex, $this->value);
|
$agent->setPayment($complex, $this->newValue);
|
||||||
$this->value = null;
|
$this->newValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPaymentAsParentForAgent(Agent $agent, Complex $complex)
|
public function setPaymentAsParentForAgent(Agent $agent, Complex $complex)
|
||||||
{
|
{
|
||||||
$agent->setAsParentPayment($complex);
|
$agent->setAsParentPayment($complex);
|
||||||
$this->value = null;
|
$this->newValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unsetPaymentForAgent(Agent $agent, Complex $complex)
|
public function unsetPaymentForAgent(Agent $agent, Complex $complex)
|
||||||
@ -53,6 +53,21 @@ public function unsetPaymentForAgent(Agent $agent, Complex $complex)
|
|||||||
$agent->unsetPayment($complex);
|
$agent->unsetPayment($complex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setPaymentForAllAgentOfCompany(Company $company, Complex $complex)
|
||||||
|
{
|
||||||
|
$compPayment = $company->getPaymentable($complex);
|
||||||
|
$compPayment = $compPayment->value;
|
||||||
|
if ($compPayment == null || $compPayment == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$agents = Agent::where('company_id', $company->id)->get();
|
||||||
|
foreach ($agents as $agent)
|
||||||
|
{
|
||||||
|
$agent->setPayment($complex, $compPayment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
if ($this->companyId)
|
if ($this->companyId)
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
Route::post('/admin/companies/{company}/delete', [Modules\Admin\Http\Controllers\AdminUsersController::class, 'update'])->name('admin.companies.delete');
|
Route::post('/admin/companies/{company}/delete', [Modules\Admin\Http\Controllers\AdminUsersController::class, 'update'])->name('admin.companies.delete');
|
||||||
|
|
||||||
Route::get('/admin/cities', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'index'])->name('admin.cities');
|
Route::get('/admin/cities', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'index'])->name('admin.cities');
|
||||||
Route::get('/admin/cities/{city}/edit', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'edit'])->name('admin.cities.edit');
|
Route::post('/admin/cities/{city}/update', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'update'])->name('admin.cities.update');
|
||||||
Route::post('/admin/cities/create', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'create'])->name('admin.cities.create');
|
Route::post('/admin/cities/create', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'create'])->name('admin.cities.create');
|
||||||
Route::post('/admin/cities/{city}/delete', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'delete'])->name('admin.cities.delete');
|
Route::post('/admin/cities/{city}/delete', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'delete'])->name('admin.cities.delete');
|
||||||
Route::post('/admin/cities/{city}/restore', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'restore'])->withTrashed()->name('admin.cities.restore');
|
Route::post('/admin/cities/{city}/restore', [Modules\Admin\Http\Controllers\AdminCitiesController::class, 'restore'])->withTrashed()->name('admin.cities.restore');
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
@php($title = 'Города')
|
@php($title = 'Города')
|
||||||
@extends('layouts.admin')
|
@extends('layouts.admin')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
<style>
|
||||||
|
.collapsing {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="d-flex mb-3">
|
<div class="d-flex mb-3">
|
||||||
<form class="p-2 border rounded-3 border-1 bg-white" method="GET" action="{{ route('admin.cities') }}">
|
<form class="p-2 border rounded-3 border-1 bg-white" method="GET" action="{{ route('admin.cities') }}">
|
||||||
<input type="radio" class="btn-check" name="filter" value="all" id="option_all" autocomplete="off"
|
<input type="radio" class="btn-check" name="filter" value="all" id="option_all" autocomplete="off"
|
||||||
@ -36,7 +41,19 @@
|
|||||||
@foreach ($cities as $city)
|
@foreach ($cities as $city)
|
||||||
<tr scope="row" class="@if ($city->trashed()) bg-secondary @endif">
|
<tr scope="row" class="@if ($city->trashed()) bg-secondary @endif">
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
{{ $city->name }}
|
<div class="collapse show" data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#collapseName{{ $city->id }}" id="collapseName{{ $city->id }}">
|
||||||
|
{{ $city->name }}
|
||||||
|
</div>
|
||||||
|
<div class="collapse" id="collapseName{{ $city->id }}">
|
||||||
|
<form action="{{ route('admin.cities.update', ['city' => $city]) }}" method="post">
|
||||||
|
@csrf
|
||||||
|
<input class="form-control form-control-lg w-100" name="name" type="text"
|
||||||
|
value="{{ $city->name }}" placeholder="Название города"
|
||||||
|
aria-label="default input example">
|
||||||
|
<input type="submit" hidden />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ $city->created_at ? $city->created_at->diffForHumans() : '' }}
|
{{ $city->created_at ? $city->created_at->diffForHumans() : '' }}
|
||||||
@ -59,9 +76,12 @@
|
|||||||
<button class="dropdown-item" type="submit">Восстановить</button>
|
<button class="dropdown-item" type="submit">Восстановить</button>
|
||||||
</form>
|
</form>
|
||||||
@else
|
@else
|
||||||
<a class="dropdown-item"
|
<button class="dropdown-item" type="button" data-bs-toggle="collapse"
|
||||||
href="{{ route('admin.cities.edit', ['city' => $city]) }}">Редактировать</a>
|
data-bs-target="#collapseName{{ $city->id }}">
|
||||||
<form method="post" action="{{ route('admin.cities.delete', ['city' => $city]) }}">
|
Редактировать
|
||||||
|
</button>
|
||||||
|
<form method="post"
|
||||||
|
action="{{ route('admin.cities.delete', ['city' => $city]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
<button class="dropdown-item" type="submit">Удалить</button>
|
<button class="dropdown-item" type="submit">Удалить</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -1,124 +1,209 @@
|
|||||||
<div>
|
<div>
|
||||||
<button wire:click="back" class="btn border-0 icon-link icon-link-hover fs-5 mb-3 text-decoration-none text-primary"
|
<div>
|
||||||
style="--bs-icon-link-transform: translate3d(-.125rem, 0, 0);" href="#">
|
<button wire:click="back"
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left"
|
class="btn border-0 icon-link icon-link-hover fs-5 mb-3 text-decoration-none text-primary"
|
||||||
viewBox="0 0 16 16">
|
style="--bs-icon-link-transform: translate3d(-.125rem, 0, 0);" href="#">
|
||||||
<path fill-rule="evenodd"
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||||
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" />
|
class="bi bi-chevron-left" viewBox="0 0 16 16">
|
||||||
</svg>
|
<path fill-rule="evenodd"
|
||||||
{{ $company->name }}
|
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" />
|
||||||
</button>
|
</svg>
|
||||||
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
|
{{ $company->name }}
|
||||||
<table class="table m-0">
|
</button>
|
||||||
<thead>
|
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
|
||||||
<tr scope="col">
|
<table class="table m-0 table-striped-columns">
|
||||||
<th>Агент</th>
|
<thead>
|
||||||
@foreach ($complexes as $complex)
|
<tr scope="col">
|
||||||
<th>
|
<th>Агент</th>
|
||||||
{{ $complex->name }}
|
|
||||||
<div>
|
|
||||||
@php($compPayment = $company->getPaymentable($complex))
|
|
||||||
<span class="badge bg-secondary">
|
|
||||||
@if ($compPayment->value === null)
|
|
||||||
Не установлено
|
|
||||||
@elseif($compPayment->value == -1)
|
|
||||||
Наследовать
|
|
||||||
@else
|
|
||||||
{{ $compPayment->value }} %
|
|
||||||
@endif
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</th>
|
|
||||||
@endforeach
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class=" ">
|
|
||||||
@foreach ($agents as $agent)
|
|
||||||
<tr scope="row">
|
|
||||||
<td class="align-middle">
|
|
||||||
{{ $agent->user->name }}
|
|
||||||
</td>
|
|
||||||
@foreach ($complexes as $complex)
|
@foreach ($complexes as $complex)
|
||||||
@php($paymentable = $agent->getPaymentable($complex))
|
<th>
|
||||||
<td>
|
{{ $complex->name }}
|
||||||
@if ($paymentable->value == null)
|
<div>
|
||||||
|
{{ $complex->city->name }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
@php($compPayment = $company->getPaymentable($complex))
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
|
<a class="btn bg-secondary-subtle btn-sm text-truncate" href="#"
|
||||||
aria-expanded="false">
|
role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
Не установлено
|
@if ($compPayment->value === null)
|
||||||
</button>
|
Не установлено
|
||||||
|
@elseif($compPayment->value == -1)
|
||||||
|
Наследовать
|
||||||
|
@else
|
||||||
|
{{ $compPayment->value }} %
|
||||||
|
@endif
|
||||||
|
<i class="bi bi-three-dots-vertical"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item" href="#">
|
<a class="dropdown-item " href="#">
|
||||||
<input class="form-control form-control-sm" type="text"
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
placeholder="Процент вознаграждения" wire:model = "value"
|
</span>
|
||||||
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor" class="bi bi-percent"
|
||||||
|
viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $compPayment->value }}"
|
||||||
|
wire:model.lazy = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
@if ($compPayment->value)
|
||||||
<hr class="dropdown-divider">
|
<li>
|
||||||
</li>
|
<hr class="dropdown-divider">
|
||||||
<li><button class="dropdown-item"
|
</li>
|
||||||
wire:click="setPaymentAsParentForAgent({{ $agent->id }}, {{ $complex->id }})">Наследовать</button>
|
<li>
|
||||||
</li>
|
<button class="dropdown-item"
|
||||||
|
wire:click="setPaymentForAllAgentOfCompany({{ $company->id }}, {{ $complex->id }})">Установить
|
||||||
|
{{ $compPayment->value }}
|
||||||
|
% для всех агентов</button>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@elseif($paymentable->value == -1)
|
</div>
|
||||||
<div class="dropdown">
|
</th>
|
||||||
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
|
|
||||||
aria-expanded="false">
|
|
||||||
Наследовать
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="#">
|
|
||||||
<input class="form-control form-control-sm" type="text"
|
|
||||||
placeholder="Процент вознаграждения" wire:model = "value"
|
|
||||||
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<hr class="dropdown-divider">
|
|
||||||
</li>
|
|
||||||
<li><button class="dropdown-item"
|
|
||||||
wire:click="unsetPaymentForAgent({{ $agent->id }}, {{ $complex->id }})">Без
|
|
||||||
вознаграждения</button></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div class="dropdown">
|
|
||||||
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
|
||||||
aria-expanded="false">
|
|
||||||
{{ $paymentable->value }} %
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="#">
|
|
||||||
<input class="form-control form-control-sm" type="text"
|
|
||||||
placeholder="Процент вознаграждения"
|
|
||||||
value="{{ $paymentable->value }}" wire:model = "value"
|
|
||||||
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<hr class="dropdown-divider">
|
|
||||||
</li>
|
|
||||||
<li><a class="dropdown-item disabled" href="#">Наследовать</a></li>
|
|
||||||
<li><button class="dropdown-item"
|
|
||||||
wire:click="unsetPaymentForAgent({{ $agent->id }}, {{ $complex->id }})">Без
|
|
||||||
вознаграждения</button>
|
|
||||||
</li>
|
|
||||||
<li><button class="dropdown-item"
|
|
||||||
wire:click="setPaymentAsParentForAgent({{ $agent->id }}, {{ $complex->id }})">Наследовать</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
</thead>
|
||||||
</tbody>
|
<tbody class=" ">
|
||||||
</table>
|
@foreach ($agents as $agent)
|
||||||
|
<tr scope="row">
|
||||||
|
<td class="align-middle">
|
||||||
|
{{ $agent->user->name }}
|
||||||
|
</td>
|
||||||
|
@foreach ($complexes as $complex)
|
||||||
|
@php($paymentable = $agent->getPaymentable($complex))
|
||||||
|
<td>
|
||||||
|
@if ($paymentable->value == null)
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
Не установлено
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor"
|
||||||
|
class="bi bi-percent" viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}"
|
||||||
|
wire:model = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="setPaymentAsParentForAgent({{ $agent->id }}, {{ $complex->id }})">Наследовать</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@elseif($paymentable->value == -1)
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
Наследовать
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor"
|
||||||
|
class="bi bi-percent" viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}"
|
||||||
|
wire:model = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="unsetPaymentForAgent({{ $agent->id }}, {{ $complex->id }})">Без
|
||||||
|
вознаграждения</button></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
{{ $paymentable->value }} %
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor"
|
||||||
|
class="bi bi-percent" viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}"
|
||||||
|
wire:model = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForAgent({{ $agent->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="unsetPaymentForAgent({{ $agent->id }}, {{ $complex->id }})">Без
|
||||||
|
вознаграждения</button>
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="setPaymentAsParentForAgent({{ $agent->id }}, {{ $complex->id }})">Наследовать</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
@endforeach
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,97 +1,144 @@
|
|||||||
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
|
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
|
||||||
<table class="table m-0">
|
<div>
|
||||||
<thead>
|
<table class="table m-0 table-striped-columns ">
|
||||||
<tr scope="col">
|
<thead>
|
||||||
<th>Компания</th>
|
<tr scope="col">
|
||||||
@foreach ($complexes as $complex)
|
<th>Компания</th>
|
||||||
<th>{{ $complex->name }}
|
|
||||||
</th>
|
|
||||||
@endforeach
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class=" ">
|
|
||||||
@foreach ($companies as $company)
|
|
||||||
<tr scope="row">
|
|
||||||
<td class="align-middle">
|
|
||||||
{{ $company->name }}
|
|
||||||
</td>
|
|
||||||
@foreach ($complexes as $complex)
|
@foreach ($complexes as $complex)
|
||||||
@php($paymentable = $company->getPaymentable($complex))
|
<th>{{ $complex->name }}
|
||||||
<td>
|
<div>
|
||||||
@if ($paymentable->value == null)
|
{{ $complex->city->name }}
|
||||||
<div class="dropdown">
|
</div>
|
||||||
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
|
</th>
|
||||||
aria-expanded="false">
|
|
||||||
Не установлено
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="#">
|
|
||||||
<input class="form-control form-control-sm" type="text"
|
|
||||||
placeholder="Процент вознаграждения" wire:model = "value"
|
|
||||||
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@elseif($paymentable->value == -1)
|
|
||||||
<div class="dropdown">
|
|
||||||
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
|
|
||||||
aria-expanded="false">
|
|
||||||
Наследовать
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="#">
|
|
||||||
<input class="form-control form-control-sm" type="text"
|
|
||||||
placeholder="Процент вознаграждения" wire:model = "value"
|
|
||||||
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<hr class="dropdown-divider">
|
|
||||||
</li>
|
|
||||||
<li><button class="dropdown-item"
|
|
||||||
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
|
|
||||||
вознаграждения</button></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div class="dropdown">
|
|
||||||
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
|
||||||
aria-expanded="false">
|
|
||||||
{{ $paymentable->value }} %
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="#">
|
|
||||||
<input class="form-control form-control-sm" type="text"
|
|
||||||
placeholder="Процент вознаграждения"
|
|
||||||
value="{{ $paymentable->value }}" wire:model = "value"
|
|
||||||
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<hr class="dropdown-divider">
|
|
||||||
</li>
|
|
||||||
<li><button class="dropdown-item"
|
|
||||||
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
|
|
||||||
вознаграждения</button>
|
|
||||||
</li>
|
|
||||||
<!--<li><a class="dropdown-item" href="#">Something else here</a></li>-->
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
<td>
|
|
||||||
<button class="btn btn-light" wire:click="setCompany({{ $company->id }})">
|
|
||||||
<i class="bi bi-chevron-right"></i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
</thead>
|
||||||
</tbody>
|
<tbody class=" ">
|
||||||
</table>
|
@foreach ($companies as $company)
|
||||||
|
<tr scope="row">
|
||||||
|
<td class="">
|
||||||
|
<a class="text-dark icon-link icon-link-hover text-decoration-none" href="#"
|
||||||
|
wire:click="setCompany({{ $company->id }})">
|
||||||
|
{{ $company->name }}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||||
|
class="bi bi-chevron-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
@foreach ($complexes as $complex)
|
||||||
|
@php($paymentable = $company->getPaymentable($complex))
|
||||||
|
<td class="align-middle">
|
||||||
|
@if ($paymentable->value == null)
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
Не установлено
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor" class="bi bi-percent"
|
||||||
|
viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}" wire:model = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@elseif($paymentable->value == -1)
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
Наследовать
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor" class="bi bi-percent"
|
||||||
|
viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}" wire:model = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
|
||||||
|
вознаграждения</button></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
{{ $paymentable->value }} %
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item " href="#">
|
||||||
|
<span class="badge text-dark">Введите размер вознаграждения:
|
||||||
|
</span>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text" id="basic-addon1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20"
|
||||||
|
height="20" fill="currentColor" class="bi bi-percent"
|
||||||
|
viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0M4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
placeholder="Вознаграждение"
|
||||||
|
value="{{ $paymentable->value }}"
|
||||||
|
wire:model.lazy = "newValue"
|
||||||
|
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li><button class="dropdown-item"
|
||||||
|
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
|
||||||
|
вознаграждения</button>
|
||||||
|
</li>
|
||||||
|
<!--<li><a class="dropdown-item" href="#">Something else here</a></li>-->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
@endforeach
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
use App\Models\Complex;
|
use App\Models\Complex;
|
||||||
trait Paymentable
|
trait Paymentable
|
||||||
{
|
{
|
||||||
private $defaultValue = null; // -1 || null
|
private $defaultValue = -1; // -1 || null
|
||||||
protected static function boot()
|
protected static function boot()
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
@ -15,11 +15,6 @@ protected static function boot()
|
|||||||
{
|
{
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
static::deleted(function ($item)
|
|
||||||
{
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getClassName()
|
private function getClassName()
|
||||||
|
|||||||
@ -5,6 +5,10 @@ .bg-primary {
|
|||||||
border-color: #ce4711 !important;
|
border-color: #ce4711 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
color: rgba(var(--bs-body-color-rgb), .65);
|
||||||
|
}
|
||||||
|
|
||||||
.btn-secondary,
|
.btn-secondary,
|
||||||
.btn-secondary:disabled {
|
.btn-secondary:disabled {
|
||||||
color: white;
|
color: white;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user